Neon Docs search is now built on Neon
Neon's docs search now runs entirely on its own stack: Lakebase Postgres with the lakebase_vector (pgvector-compatible ANN) and lakebase_text (BM25) extensions, a Hono API on Neon Functions, and Neon AI Gateway for embeddings and reranking. Pages are ingested as markdown via a GitHub Action, chunked by heading, embedded and stored with tsvectors in one table. To fit search-as-you-type latency budgets, full hybrid results (ANN plus BM25 merged with reciprocal rank fusion, then an LLM rerank) are precomputed for common queries and cached, while unseen queries fall back to BM25 only. Cache hits take 1.9 ms and BM25 misses 8.6 ms at p50 on the server, and top-5 hit rate rose from 80% to 94% on 171 real queries.
Related posts
- CommSync Runs Text, Vector, and Hybrid Search on Postgres with Lakebase Search
Neon mediumAdept
CommSync, a unified SMS/email inbox, runs keyword, semantic and hybrid search entirely in Postgres using Neon's Lakebase Search extensions. lakebase_text provides BM25 search with top-K pushdown over tsvector, and lakebase_vector is a pgvector-compatible drop-in with an ANN index. Warm inbox search went from about 19.5s with cold-start GIN to about 18.6ms. The cmd+k palette fuses lexical and semantic results with weighted RRF (k=60, lexical 1.0, semantic 0.8) in two tiers: a 110ms lexical pass per keystroke and a debounced 420ms hybrid pass. Agent RAG uses exact nearest-neighbor on small per-org knowledge bases, with tenancy and permissions expressed as plain WHERE clauses.
- Lakebase Search: the retrieval primitive for agents on Neon
Neon mediumAdept
Lakebase Search adds vector and BM25 search to Lakebase Postgres through two extensions, lakebase_vector and lakebase_text, so agents can query operational data without a separate search system. lakebase_vector keeps its durable index in object storage, caches hot pages in NVMe and RAM, and combines hierarchical IVF with RaBitQ quantization. That design lets compute scale to zero and reconnect without rebuilding the index, and it stays compatible with pgvector types, operators and query syntax. lakebase_text adds a BM25 index over standard tsvector with top-K pushdown, and TypeScript Neon Functions, Object Storage triggers and AI Gateway embeddings round out an ingest-to-hybrid-search pipeline that agents can call in a search-evaluate-retry loop.
- Lakebase Search: vector and BM25 on Neon
Neon mediumAdept
Neon's Lakebase Search adds two Postgres extensions, lakebase_vector (IVF partitioning plus RaBitQ quantization, pgvector-compatible) and lakebase_text (a BM25-native index with Block-Max WAND top-K pushdown), designed for Neon's separated compute and object-storage tiers. HNSW's dependent random reads serialize into tens-of-millisecond round trips on object storage, so the new indexes map clusters and postings to contiguous blocks fetched in parallel. RaBitQ's ~32x compression fits a 100M-vector index in under 10GB versus ~300GB for HNSW, with builds 50–100x faster, and indexes persist on object storage so scale-to-zero and copy-on-write branching work without rebuilds. Hybrid search runs as plain SQL in one transaction, and lakebase_ann_prewarm() is available to avoid cold-cache latency.
- Semantic search using OpenAI, pg_embedding and Neon
Neon mediumAdept
A YC idea-matcher app implements semantic search by embedding ~4,400 YCombinator company descriptions with OpenAI's text-embedding-ada-002 (1536 dimensions) and storing them as real[] columns in Neon Postgres via the pg_embedding extension. Queries embed the user's idea and order rows by cosine distance (<=>) to return the top five matches from a Next.js edge function, which is colocated with the database region and uses the Neon serverless driver, Upstash rate limiting and Zod validation. The full ingestion script and API route are shown. Sequential scan is fine for this small dataset, but larger tables need an HNSW index. pg_embedding has since been deprecated in favor of pgvector.
- Search From a Million Books in Milliseconds With Neon and pg_search
Neon mediumAdept
Swapping the OpenAI-embedding semantic search in Vercel's Next.js Book Inventory template for pg_search's BM25 full-text index on Neon Postgres made title searches over a million Goodreads books roughly 180–236x faster, dropping from about 2.7 seconds to 11–14 ms. The setup loads the dataset into a books table, prewarms the table and index with pg_prewarm, creates a covering bm25 index, and queries with the @@@ operator and paradedb.match in conjunction_mode. On the app side, Drizzle is replaced by Neon's HTTP serverless driver, and Vercel functions are co-located in us-east-2 with the database. Side-by-side tsvector/tsquery and pg_search queries with timings are included for reproduction.