LLMs & Generative AI
Retrieval-Augmented Generation (RAG)
RAG retrieves external evidence at answer time and gives it to the model as context. It separates knowledge storage from language generation, making answers more current, inspectable, and citeable.
- RAG is for knowledge outside the model
- Retrieval quality dominates answer quality
- Chunking defines the unit of memory
- Reranking improves precision after broad retrieval
- Citations require source tracking
- RAG does not guarantee truth
| Failure | Symptom | Fix |
|---|---|---|
| Bad chunking | Relevant answer split or missing context | Chunk by sections, include headings |
| Low recall | Correct source not in top-k | Hybrid retrieval, better embeddings |
| Low precision | Context full of distractors | Reranking, filters, metadata |
| Stale source | Answer uses old policy | Freshness filters, source versioning |
| No grounding check | Answer goes beyond evidence | Require citations / abstain behavior |