Retrieval-Augmented Generation (RAG)
Retrieval-augmented generation combines a language model with an external retrieval step. Before generating, the system fetches relevant documents from a knowledge source and supplies them as context, so answers are grounded in specific, up-to-date data rather than relying solely on the model's parametric memory.
Definition
Retrieval-Augmented Generation (RAG)RAG separates knowledge from the model's weights. A retriever — usually powered by embeddings and a vector database — finds passages relevant to the query, and those passages are inserted into the prompt so the generator can cite and reason over them. This reduces hallucination, allows the knowledge base to be updated without retraining, and supports source attribution.
The pattern originates from work by Lewis et al., who paired a neural retriever with a sequence-to-sequence generator. Production RAG systems add chunking, reranking, and grounding checks to improve which passages reach the model and how faithfully it uses them.
Frequently asked questions
What is Retrieval-Augmented Generation (RAG)?
Retrieval-augmented generation combines a language model with an external retrieval step. Before generating, the system fetches relevant documents from a knowledge source and supplies them as context, so answers are grounded in specific, up-to-date data rather than relying solely on the model's parametric memory.