Skip to content

Repository files navigation

using-typesafe-and-pinecone

Try the live demo →

A collection of examples using TypeSafe's Jev model and Pinecone together. Each one is self-contained, with its own package.json and its own deploy, and shares the API keys in the repo-root .env.

Examples

More coming soon! If you have an example, or want to request one, make an Issue or PR!

Use TypeSafe's Jev with Pinecone to filter out and rerank results in natural language. Great for when you have reranking criteria that aren't quite good enough for normal rerankers, and need high quality specification for each criteria.

Pinecone full-text search retrieves 200 candidates; a TypeSafe judgment reranks them to 10 by natural-language criteria, alongside a Claude baseline.

Clicking a preset, prefilling the query, and reranking 200 candidates

Deploy with Vercel

A fresh deploy starts with an empty Pinecone index. Clone the repo, set PINECONE_API_KEY, and run npm run ingest once to load the 2,155 bird articles before the deployed app returns results.

Setup

cp .env.example .env   # then fill in the keys
Variable Required Used for
PINECONE_API_KEY yes Retrieval
TYPESAFE_API_KEY yes Reranking judgments
ANTHROPIC_API_KEY no The Claude baseline column; omit and it stays disabled

Running an example

cd examples/nli-reranking
npm install
npm run ingest   # once, to build and populate the Pinecone index
npm run dev

Working on an example

npm run check   # typecheck, lint, format, tests — no API calls, no credits spent

CI discovers every directory under examples/ with a package.json and runs check and build for each, so a new example is picked up with no workflow edit. node scripts/check-examples.mjs runs the same conventions check locally.

Re-record the demo GIF with the dev server running (needs ffmpeg):

npm run record-demo

Agent skills

Use the Pinecone + TypeSafe skill to build TypeSafe into your own Pinecone workflows. WIP, we're still tweaking this, but let us know what you think!

  • pinecone-typesafe-retrieval — where a TypeSafe judgment fits around a Pinecone call: routing, picking a retrieval mode, gating a query, and reranking results.
  • record-demo-gif — recording and re-recording an example's demo GIF.

Releases

Packages

Used by

Contributors

Languages