RAG in production: where retrieval actually fails
Retrieval-augmented generation looks simple in demos: embed documents, find the closest chunks, paste them into the prompt. In production most failures happen before the model sees anything.
Typical failure points
- Chunks cut tables and lists in half, so the answer is split across two pieces.
- The query uses different words than the document; pure vector search misses it.
- Old versions of a document outrank the current one.
- Too many chunks are added and the relevant sentence is buried in the middle.
What helps
Hybrid search (keyword + vectors), a reranker on the top 20–50 candidates, metadata filters for dates and versions, and chunking that respects document structure. Log the retrieved chunks for every answer so you can see what the model was given.
Measure retrieval separately
Before judging answer quality, check whether the right chunk was retrieved at all. Recall@10 on a labelled set tells you whether to fix the search or the prompt.