Glossary
RAG (retrieval-augmented generation) — Glossary
A pattern that retrieves relevant documents and conditions a generative model on that evidence to improve grounded answers.
Full definition
Retrieval-augmented generation (RAG) connects a generator to an external knowledge source at query time. The system embeds or otherwise searches a corpus, selects top passages, and inserts them into the model context so answers can quote or rely on current, domain-specific material.
RAG quality depends on chunking, retrieval relevance, context assembly, and citation UX. It reduces some hallucinations but can still fail if retrieval misses key documents, if passages conflict, or if the model ignores evidence. Evaluation should score both retrieval and final answer faithfulness.