What Is Retrieval-Augmented Generation?

AI-generated photorealistic editorial scene explaining retrieval-augmented generation

Retrieval-Augmented Generation Explainer

Retrieval-augmented generation, or RAG, combines information retrieval with a generative model. Instead of relying only on patterns stored in model parameters, the system searches an external collection and places selected passages into the context used to produce an answer.

A typical pipeline divides documents into searchable chunks, converts them into representations, and stores them in an index. When a question arrives, a retriever ranks likely matches. The model receives the question plus those passages and writes a response grounded in the supplied material.

RAG can make answers more current, domain-specific, and auditable because the knowledge collection can be updated without retraining the whole model. It can also support citations, although a citation is useful only when the retrieved passage actually supports the claim beside it.

Retrieval does not guarantee truth. Weak queries, poor chunking, stale documents, misleading sources, or a model that ignores the evidence can still produce errors. Good systems evaluate retrieval and generation separately, control access to sensitive documents, and show users where important claims came from.

Retrieval-augmented generation lets an AI system search an external collection for relevant evidence before it writes an answer.

Key terms include retriever, document chunk, index, embedding, query, ranking, context, grounding and citation.

The query is used to rank document chunks by relevance. Selected chunks are inserted into the model context, usually with instructions about how to use and cite them.

Hybrid systems may combine keyword search with semantic retrieval, rerank the candidates, and filter results by date, permissions, or source quality.

RAG can update an application quickly and make its evidence inspectable, but retrieval quality becomes a new dependency that must be measured.

Teams should test unsupported claims, missing evidence, prompt injection inside documents, permission leaks, and questions for which the collection has no answer.

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.