Retrieval-Augmented Generation (RAG)
Retrieval-augmented generation (RAG) is a method where an AI system first retrieves relevant documents or web pages, then has a language model write its answer using those sources.
What is Retrieval-Augmented Generation (RAG)?
Retrieval-augmented generation (RAG) is an AI technique that pairs a search step with a language model. The system retrieves relevant documents for a question, adds the best passages to the model’s prompt, and the model writes an answer based on them, often with citations. Most AI search engines use a form of RAG.
How it works
flowchart LR
A[User question] --> B[Retriever searches index or web]
B --> C[Top passages selected]
C --> D[LLM writes answer from passages]
D --> E[Answer with citations]
The approach was described in a 2020 paper by Lewis et al. and is now standard in AI products. In web-scale AI search, the retriever is usually a search engine index plus a re-ranker, and documents are split into chunks so only the most relevant passages reach the model.
Two practical consequences for content teams:
- Retrieval is the gate. A page that is not indexed, blocked to the engine’s crawler, or not relevant to the sub-queries will never reach the model.
- Passages compete, not pages. A long page with one clear, self-contained answer can beat a better overall page whose key point is buried.
Examples
- Perplexity answers “how does passkey authentication work” by retrieving several explainers and citing the two with the clearest step-by-step passages.
- A company builds an internal RAG assistant over its own docs, which shows the same principle: well-structured docs produce better answers.
- Google AI Mode runs many retrievals for sub-questions, then combines them, a pattern known as query fan-out.
RAG also explains why freshness matters more in AI search than many teams expect. When an engine retrieves at answer time, a page updated last week can be cited the same day it is crawled, while model training data may be many months old.
How to apply it
- Make sure key pages are indexed and accessible to AI crawlers.
- Write sections that make sense on their own, with the answer in the first sentence.
- Use descriptive headings so chunks carry their own context.
- Keep facts current; retrieval favors fresh, specific content for time-sensitive queries.
- Cover sub-questions buyers ask, not just the head term.
See how AI engines cite for how retrieval turns into citations.
Related terms
Frequently asked questions
Why does RAG matter for SEO?
AI search engines use RAG to choose which pages to read and cite. If your page is not retrieved, it cannot be cited, so indexability, relevance and clear passages still decide visibility.
Who introduced RAG?
The term comes from a 2020 research paper by Lewis and colleagues at Facebook AI Research, which combined a retriever with a text generator for knowledge-intensive tasks.
Does RAG stop hallucinations?
It reduces them by giving the model sources to work from, but it does not remove them. Models can still misread or over-generalize from retrieved text.