// the find
gannonh/chatgpt-pgvector
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.