AI · 20 November 2026 · 2 min read
Retrieval-augmented generation is easy to prototype and surprisingly hard to make reliable. Here's where production RAG systems succeed or fail.
A retrieval-augmented generation prototype can be built in an afternoon: split some documents, embed them, retrieve the closest chunks and ask a model to answer using them. The demo usually looks great. Then real users arrive with real questions, and the gap between 'works on my examples' and 'works for the business' becomes obvious.
Most of that gap has little to do with the language model. It sits in the data pipeline, the retrieval step, and whether anyone can tell if the system is getting better or worse.
1. Retrieval quality is the ceiling
A model can only answer well from what it's given. If the right passage isn't retrieved, no prompt will rescue the answer. That makes retrieval the first thing to measure and improve.
- Chunk by meaning, not by character count. Headings, sections and tables should stay intact where possible.
- Keep metadata — document title, section, date, owner, permissions — and use it for filtering and for citations.
- Combine semantic search with keyword search. Product codes, names and acronyms are often found more reliably by exact matching.
- Re-rank the top candidates before passing them to the model, so the best few chunks fill the context rather than the first few.
2. Build an evaluation set before you tune anything
Without a fixed set of questions and expected answers, every change is judged by gut feel. Collect real questions from the people who'll use the system, write down what a good answer contains and which documents it should come from, and score every release against that set.
Measure retrieval separately from generation. If the right documents aren't in the retrieved set, fix retrieval. If they are and the answer is still wrong, look at prompting, context size or model choice.
If you can't measure whether a change made answers better, you're not improving the system — you're just changing it.
3. Citations and honest uncertainty build trust
Users trust answers they can verify. Show which documents an answer came from and link to them. Just as important, let the system say 'I couldn't find this' instead of guessing. A confident wrong answer does more damage than an honest gap — and gaps are useful signals for which content is missing.
4. Permissions are not optional
In most organisations, not everyone may see every document. If your index ignores that, your assistant becomes a way around access controls. Store permission metadata with each chunk and filter at query time based on who is asking.
5. Treat cost and latency as features
- Cache embeddings and frequent answers.
- Route simple questions to smaller, faster models and reserve larger models for complex ones.
- Stream responses so users see progress immediately.
- Track cost per query and per feature, not just the monthly bill.
6. Observe everything
Log the question, the retrieved chunks, the prompt version, the model, the answer and any user feedback. When something goes wrong, you need to know which step failed. Over time, these traces become your best source of new evaluation cases.
The takeaway
Reliable RAG is mostly good engineering: careful data preparation, measurable retrieval, honest answers, respected permissions and visibility into what's happening. The model matters — but it's rarely the bottleneck.
Keep reading
20 November 2026 · 2 min read
Choosing a tech stack for your SaaS MVP
Your MVP stack should help you learn fast without boxing you in. A practical guide to what to decide now — and what to postpone.
20 November 2026 · 2 min read
React Native, Flutter or native? A practical decision guide
Cross-platform frameworks have matured enormously. Here's how to decide which approach fits your product, team and roadmap.