finds.dev← search

// the find

supabase-community/nextjs-openai-doc-search

★ 1,724 · TypeScript · Apache-2.0 · updated May 2026

Template for building your own custom ChatGPT style doc search powered by Next.js, OpenAI, and Supabase.

A Next.js starter that indexes your MDX docs as embeddings in Supabase/pgvector, then answers user questions by retrieving relevant sections and piping them into an OpenAI completion with streaming. Targeted at teams who want doc-site search that actually understands natural language questions rather than keyword matching. The Supabase integration handles the Vercel deploy wiring automatically.

The checksum-based embedding invalidation in generate-embeddings.ts is the right call — only re-embeds changed files at build time instead of nuking and recreating everything. Running the search as a Vercel Edge Function keeps latency low since it stays close to the streaming response. The migration SQL ships with the repo so local dev with `supabase start` gives you a real pgvector instance, not a mock. Streaming the OpenAI completion directly to the client avoids the awkward 'waiting...' UX that plagues most RAG demos.

Hard-wired to OpenAI's text-completion endpoint (GPT-3 era) rather than the chat completions API, which means you're stuck with a worse model than what's available now and the prompting patterns are dated. Only ingests MDX files from the pages directory — no way to feed it arbitrary content sources without surgery on generate-embeddings.ts. No rate limiting or auth on the vector-search API route, so a public deployment will burn your OpenAI quota freely. The repo has had minimal commits since 2023; the dependency versions are aging and there's been no migration to the newer OpenAI SDK or pgvector v0.5+ features.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →