Self-contained scripts that show how to use ParadeDB from Drizzle. Run them all with pnpm examples, or follow the setup below and run them one at a time.
# Install pnpm: https://pnpm.io/installation
pnpm installpnpm db:setupThis starts a ParadeDB container via Docker and exports DATABASE_URL. If you already have a Postgres instance with ParadeDB installed, set DATABASE_URL yourself instead:
export DATABASE_URL=postgresql://user:password@localhost:5432/dbnameThe "Hello World" of ParadeDB. Covers declaring a ParadeDB index on a table, running keyword queries, sorting by BM25 relevance, and highlighting matched terms in snippets.
pnpm examples quickstart.tsTop-K nearest-neighbor retrieval over pgvector vector columns. ParadeDB indexes the vector column inside its search index, so one index serves both keyword and vector queries.
Requires the pgvector extension, which is included in the ParadeDB Docker image.
pnpm examples vector-search.tsBuilds an e-commerce-style filter sidebar. Computes search results and facet counts (by category, rating, and so on) together in a single query.
pnpm examples faceted-search.tsCombines BM25 keyword search (good for exact matches like part numbers) with vector similarity (good for meaning) using Reciprocal Rank Fusion, which ranks better than either method alone.
Requires the pgvector extension, which is included in the ParadeDB Docker image.
pnpm examples hybrid-rrf.tsA small question-answering flow. Retrieves relevant context with ParadeDB, then sends it to an LLM so answers are grounded in your own data.
Retrieval runs without any configuration. Set an OpenRouter API key to enable the generation step:
export OPENROUTER_API_KEY=sk-...
pnpm examples rag.tsAs-you-type suggestions using n-gram tokenization, which matches substrings in the middle of words — typing wir matches wireless.
pnpm examples autocomplete.ts"Related content" recommendations. Finds documents with similar keywords using TF-IDF logic, without requiring vector embeddings.
pnpm examples more-like-this.tsMost examples import from examples/common.ts, which keeps the boilerplate out of the example scripts: it opens the connection, defines the demo table, and seeds it with data.