Glossary

Retrieval-augmented generation (RAG)

An architecture that retrieves relevant documents at query time and feeds them to a language model so its answers are grounded in sources.

Also called: RAG

Retrieval-augmented generation combines a search step with a generation step: given a query, a retriever fetches the most relevant passages from an external corpus, and a large language model then generates its answer conditioned on both the query and the retrieved text, rather than on its training data alone.

The retrieval step usually relies on a vector database that stores document chunks as embeddings and finds the closest matches to the query's embedding, a form of semantic search; some implementations instead or additionally query a knowledge graph or a traditional keyword index. This differs from fine-tuning, which bakes new knowledge into the model's weights; RAG keeps knowledge external and swappable, and the retrieved passages let a system cite its sources.

RAG matters because it lets an LLM answer questions about current, private, or domain-specific material without retraining, and it reduces, but does not eliminate, hallucination by grounding answers in retrieved text. Common pitfalls include retrieving irrelevant or outdated passages, chunking documents in ways that break context, and a model that ignores or contradicts the retrieved evidence anyway.

Last reviewed September 22, 2026

In the index now

Related terms

Related tools

Related guides