AEO glossary
Retrieval-augmented generation
Also called RAG
RAG is a method where an AI system first retrieves relevant passages from an index, then generates its answer using those passages as context.
RAG comes from a 2020 research paper by Lewis and colleagues. Their model paired a text generator with "a dense vector index of Wikipedia, accessed with a pre-trained neural retriever". The retriever finds the passages most relevant to the question; the generator writes an answer conditioned on them. The paper reported that this produced more specific and factual language than a model answering from its parameters alone.
The important split is between what a model learned in training and what it looks up when asked. Training knowledge is fixed until the next model; the index can be updated without retraining.
For you, the lesson is simple: if your passage isn't retrieved, the generator never sees it, however good the model. That's why crawlability, indexing and clear, self-contained passages come first. Treat the paper as the pattern, not a blueprint of any product: Google, OpenAI, Anthropic and Perplexity each run their own retrieval systems and don't publish the details.
Learn it properly
The course covers this in How answer engines choose sources. That lesson is free.
Related terms
Sources
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al.) (opens in a new tab) · arXiv · Published 22 May 2020
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, full text (v4) (opens in a new tab) · arXiv · Published 12 Apr 2021