RAG
Recall: A RAG App That Shows Its Receipts

Most AI document tools give you a confident answer with no way to check it. Sometimes it's right, sometimes it's invented — and you can't tell which.
Recall fixes that. It's a Retrieval-Augmented Generation (RAG) app that answers questions about your documents, grounds every answer in the actual source text, and shows you the passages it used — each with a relevance score. If the answer isn't in your docs, it says so.
Live demo: https://rag-hamza.vercel.app/
What RAG actually is
A language model doesn't know your documents. RAG solves this without retraining anything: at question time, you retrieve the most relevant passages from your docs and hand them to the model as context. The model answers from what you gave it — not from its imagination.
How it works
- Chunk — documents are split into overlapping, paragraph-aware pieces.
- Embed — each chunk becomes a vector that captures its meaning (OpenAI
text-embedding-3-small). - Store — vectors go into Postgres via
pgvector, indexed with HNSW. - Retrieve — the question is embedded too, and Postgres finds the closest chunks. The core is one line of SQL:
- Generate — the top chunks go to
gpt-4o-miniwith a strict "answer only from this context" instruction, and the passages used are shown as sources.
One decision I'll defend
I used pgvector on Postgres instead of a dedicated vector database. Everything stays in one familiar system, retrieval is a plain SQL query I can read and debug, and HNSW keeps it fast well past the scale most apps need. A specialized vector DB earns its place at very large scale — but reaching for one early solves a problem you don't have yet.
What building it taught me
RAG demos make the model look like the star. Building one end to end shows the model is the easy, last step. The engineering that decides whether it's useful is all in retrieval: how you chunk, what you embed, and whether you can see what the system pulled. Get retrieval right and the answers take care of themselves.
Code and setup on GitHub.