Retrieval-Augmented Generation

Retrieval-Augmented Generation Explainer

Retrieval-augmented generation, or RAG, combines a search system with a generative language model. Instead of relying only on information encoded during training, the system finds documents related to a request and supplies selected passages as context before the model answers.

A typical pipeline divides documents into searchable chunks, stores representations in an index, retrieves candidates for a query, ranks them and places a limited selection in the model’s context window. Citations, access controls and provenance must be engineered explicitly.

RAG can connect a model to specialized or changing information without retraining the whole model. It does not guarantee truth: retrieval can miss the best source, select outdated or malicious material, or strip away context, and the model can still misread good evidence.

Strong systems evaluate retrieval and generation separately, preserve source identity, enforce permissions, test for prompt injection and say when evidence is insufficient.

RAG retrieves external material and gives selected passages to a generative model. Key terms include corpus, chunk, embedding, index, retriever, reranker, context window, provenance and grounding.

Lewis and coauthors — Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks described an influential architecture combining model memory with retrieved memory.

Documents are prepared and indexed; a query retrieves candidates; ranking chooses context; and the model generates an answer from the request and selected evidence.

Production systems may add hybrid search, metadata filters, permission checks, citation mapping and repeated retrieval during a longer task.

RAG can improve access to current or private knowledge, but weak retrieval can produce confident answers from irrelevant evidence.

It is an information architecture, not an automatic fact-checker. Evaluation should measure search recall, ranking, citation support, answer accuracy, security and behavior when evidence is missing.

Explore more "Explainers"

Discover additional explainers across politics, science, business, technology, and other fields. Each explainer breaks down a complex idea into clear, everyday language—helping you better understand how major concepts, systems, and debates shape the world around us.