What is Retrieval-Augmented Generation (RAG)

Definition

Retrieval-augmented generation (RAG) is a technique that improves language-model responses by first retrieving relevant documents from an external knowledge source and supplying them to the model as context, so answers are grounded in current, specific data rather than the model's training alone.
« Back to Glossary Index
  • Grounds answers in your own, current data rather than stale training knowledge
  • Reduces hallucination by giving the model relevant source context
  • Lets models answer about private or domain-specific content without retraining
  • Provides traceable citations back to the retrieved source documents

Real World Example

A legal firm builds a RAG assistant that retrieves the relevant clauses from its contract repository and feeds them to an LLM, so lawyers get answers grounded in their actual documents with references, not the model's guesses.

FAQs

Why use RAG instead of fine-tuning?

RAG injects fresh, specific knowledge at query time without retraining, making it cheaper and easier to keep answers current.

What are the core components of RAG?

A retriever that finds relevant documents, often via vector search, and a generator model that produces an answer from them.

How does RAG reduce hallucination?

By grounding the model in retrieved source text, it anchors responses to real data and can cite where answers came from.

Hello popup window