Retrieval-Augmented Generation (RAG)
RAG retrieves relevant information from an external knowledge source and supplies that information as context to a generative model. It is useful when answers need information that is private, frequently changing, or outside the model's training knowledge.
Core flow
Documents → parse/chunk → embeddings/index → query → retrieve/rank → context → model → answer
Why use RAG?
- Ground responses in a controlled source of information.
- Update knowledge without retraining the foundation model.
- Return citations or source references when the retrieval system preserves provenance.
- Apply access controls to retrieved information.
RAG is not automatically accurate
A RAG application can still produce unsupported answers if retrieval is poor, context is incomplete, authorization is wrong, or the model ignores the evidence. Evaluate retrieval and generation separately.
Production checklist
- Version ingestion and chunking rules.
- Use an embedding model appropriate for the data and language.
- Measure retrieval quality on representative queries.
- Apply document-level authorization where required.
- Monitor stale indexes and ingestion failures.
- Evaluate groundedness and answer quality.
Connected knowledge
embeddings → vector-search troubleshooting → RAG hallucinations → production RAG architecture.





