Retrieval and search · MLD-1033

Retrieval-augmented generation

Generating outputs conditioned on information retrieved from an external collection during the workflow.

Expanded guide · editorial review 2026-11-01. Original definitions, examples, notes and citations are preserved below. New examples are illustrative, not benchmark results.

Prerequisites

How it works

Retrieval-augmented generation combines a retriever with a generator. A retriever selects relevant material from an external collection; the generator conditions its response on that material. This separates some updateable knowledge from model weights. The original RAG paper studies trained retrieval-generation systems; modern prompt-based pipelines are related engineering designs.

Worked example

For a campus policy assistant, index approved policies with document identifiers and revision dates. Retrieve passages for a question, provide them to the generator and require citations. If the relevant rule is absent, the assistant should report that limitation. This is a proposed design, not a tested deployment.

A useful pipeline

question -> retrieve candidates -> rerank -> assemble context -> generate -> check cited evidence. Evaluate each stage so generation cannot hide retrieval failures.

What to test

Use questions with known supporting passages. Measure retrieval recall separately from answer correctness and citation support. Include stale documents, contradictory passages and questions outside the collection.

Common pitfall

Retrieval does not guarantee grounding. An answer can cite a real document that fails to support its specific claim.

Sources for the expanded explanation

Editorial synthesis checked against the linked primary material; no independent replication is claimed.

Original example

Answer using passages from a document index.

Original caveat

Retrieval does not guarantee that generated claims are supported.

Context and aliases

Level: Intermediate. Stages: Data · Retrieval · Inference · Evaluation.

Tags: ML · NLP · SLM · LLM · IR.

Aliases: RAG.

Related concepts

Concepts linking here

Technology connections

Original references

Open original record, export or annotate →