Why RAG?
The most practical fix for the "knowledge cutoff" problem in LLMs. Instead of retraining, we feed external sources into the model at runtime.
Building the pipeline
- Chunking — Split documents into 512–1024 token chunks that preserve meaning.
- Embedding — Models like
text-embedding-3-smallorbge-base. - Vector store — pgvector or Qdrant, depending on scale.
- Retrieval + Reranking — Pull top-K, then re-rank with a cross-encoder.
- Generation — Add the context to your prompt and call the model.
Verification
Make sure the produced answers cite their sources. In our version every sentence is tagged with a <doc-id> and the UI shows the source on hover.