Skip to content

Retrieval-augmented generation (RAG)

DefinitionRetrieval-augmented generation is a method where an AI model first retrieves relevant documents, then writes its answer using them, often citing them as sources.

The term comes from a 2020 research paper by Lewis and colleagues. AI search engines are large-scale RAG systems: they search an index, pass the best passages to the model and attach citations to the answer.

Because the answer can only use what was retrieved, being retrievable (crawlable, indexed and relevant to the searches the engine runs) comes before anything else. See How AI engines pick the sources they cite.

Learn it step by step

Related terms

  • LLM (large language model): A large language model is an AI model trained on very large amounts of text to predict and generate language. GPT, Claude and Gemini are LLM families.
  • Query fan-out: Query fan-out is when an AI search system turns one question into several narrower searches, retrieves results for each and combines them into one answer.
  • Citation: A citation is a link or source reference an AI engine attaches to its answer, showing which page it took information from.

See where you stand in AI answers

Paste your site and get a free SEO, AEO and GEO audit with the fixes.