RAG (Retrieval-Augmented Generation)

A pattern where relevant documents are fetched from a knowledge base and injected into the prompt before the model answers.

RAG lets a model answer about content it never saw during training. Done well, it cites sources and reduces hallucinations. Done poorly, it dumps too much noise into the context window.

See it in the glossary →