finds.dev← search

// the find

gannonh/chatgpt-pgvector

★ 935 · TypeScript · updated May 2023

ChatGTP (gpt3.5-turbo) starter app

A starter app showing how to wire OpenAI embeddings + pgvector (via Supabase) into a Next.js chat interface, so you can ask questions against your own scraped documents instead of relying on GPT's training data. It's a proof-of-concept, not a production tool — the value is in seeing the RAG pattern end to end in a few hundred lines of TypeScript.

The core RAG loop is clear and readable: scrape → embed → store → similarity search → construct prompt → stream response. Using a Postgres function for the similarity search keeps the vector query logic version-controlled alongside the schema. The streaming response via the OpenAI API is wired up correctly, which is the part most tutorials get wrong. Good starting point if you want to understand the mechanics before reaching for a framework like LangChain.

Last commit was May 2023 — it's frozen in time and uses text-embedding-ada-002 (1536 dimensions), which OpenAI has since superseded. No chunking strategy beyond a flat 1000-character split, which will produce terrible retrieval on structured content like code or tables. The Supabase SQL setup is manual copy-paste with no migrations, so there's no way to evolve the schema without manual intervention. No evaluation or observability — you have no idea whether the retrieved chunks are actually relevant to the query.

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 →