Skip to content

Evidence-first authority page

What Is RAG (Retrieval-Augmented Generation) in AI?

A definition of retrieval-augmented generation: why it exists, how the retrieval step works, and where it fits relative to fine-tuning.

Direct answer

Retrieval-Augmented Generation (RAG) is a technique where a system retrieves relevant documents or passages from an external knowledge source at query time and includes them in the model's context before it generates a response — rather than relying only on what the model learned during training. RAG lets a model answer using current, specific, or private information it was never trained on.

Last reviewed 2026-08-29

This page remains noindex while its page-level source receipts are completed and verified. It is available for review, not presented as publication-ready authority.

Why RAG exists

A language model's training data has a cutoff date and does not include an organization's private documents, so a model asked about last week's news or an internal policy document will either say it doesn't know or, worse, generate a plausible-sounding but incorrect answer. RAG addresses this by searching a knowledge base for relevant content and handing the model that content directly, so the model is answering from provided text rather than from memory alone.

This does not eliminate incorrect answers — a model can still misread or misuse retrieved content — but it grounds the answer in a citable source, which is a meaningfully different failure mode than an ungrounded guess.

The basic pipeline

  • Index — documents are split into chunks and converted into vector embeddings, stored in a vector database.
  • Retrieve — the user's query is embedded and compared against the stored chunks to find the most relevant matches.
  • Augment — the retrieved chunks are inserted into the model's prompt as context.
  • Generate — the model produces a response grounded in the retrieved context, ideally with citations back to the source chunks.

RAG vs. fine-tuning

RAG and fine-tuning solve different problems and are often combined rather than chosen between. RAG is well suited to knowledge that changes frequently or is too large to embed in training (a document corpus, a live database) because updating the index doesn't require retraining the model. Fine-tuning is better suited to changing how a model behaves — its tone, format, or task-specific skill — rather than what facts it has access to.

Continue researching