Retrieval-Augmented Generation (RAG)
AI architecture that retrieves external documents to ground language model responses
Retrieval-Augmented Generation (RAG) combines an external information retrieval step with a generative language model so responses are grounded in up-to-date or domain-specific sources. Introduced in a May 2020 paper by Lewis et al. pairing dense vector retrieval (DPR) with a pretrained sequence-to-sequence model, RAG evolved to include training-free in-context prompting, Self-RAG self-critique, and GraphRAG. Production platforms such as Azure AI Search and AWS Bedrock evaluate retrieval relevance and generation faithfulness separately.
- Foundational Paper
- Lewis et al., arXiv:2005.11401 (May 22, 2020)1
- Retriever Basis
- Dense Passage Retrieval (DPR, April 2020)2
- Core Mechanism
- Retrieve relevant chunks -> supply to generator1
- Key Variants
- In-Context RAG, Self-RAG, GraphRAG4
- Cloud Platforms
- Azure AI Search, Amazon Bedrock Knowledge Bases7
- Evaluation Principle
- Measure retrieval quality & faithfulness separately5
Retrieval-Augmented Generation (RAG) is a technique that retrieves relevant external documents or passages for a query and supplies them as context to a language model during text generation.
Also known as RAG, Retrieval Augmented Generation
Origins and Core Mechanism
Retrieval-Augmented Generation (RAG) was formalized by Lewis et al. (May 22, 2020) to address limitations of purely parametric language models, whose factual knowledge is frozen at training time and difficult to inspect or update.1 Their formulation coupled a pretrained generative model with a non-parametric dense vector index built using Dense Passage Retrieval (DPR), comparing sequence-level conditioning (RAG-Sequence) and token-level conditioning (RAG-Token).12
- 1Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al.)arXiv ↗
- 2Dense Passage Retrieval for Open-Domain Question Answering (Karpukhin et al.)arXiv ↗
Evolution: In-Context RAG, Self-RAG, and GraphRAG
Subsequent research expanded RAG far beyond joint fine-tuning. In-Context Retrieval-Augmented Language Models (Ram et al., January 2023) showed that prepending retrieved passages directly to a frozen language model's prompt improves performance without retraining the generator.3
¶More advanced architectures added adaptive control and structured corpora: Self-RAG (Asai et al., October 2023) trains models to decide dynamically when to retrieve and to critique their own outputs using reflection tokens,4 while GraphRAG (Edge et al., April 2024) extracts entity graphs and community summaries to answer global, corpus-wide queries.6 Survey work (Gao et al., December 2023) categorizes these stages into Naive, Advanced, and Modular RAG.5
- 4Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection (Asai et al.)arXiv ↗
- 6From Local to Global: A Graph RAG Approach to Query-Focused Summarization (Edge et al.)arXiv ↗
- 5Retrieval-Augmented Generation for Large Language Models: A Survey (Gao et al.)arXiv ↗
Production Search Indexes and Knowledge Bases
In enterprise deployments documented by Microsoft Learn (Azure AI Search) and Amazon Web Services (Amazon Bedrock Knowledge Bases), RAG pipelines ingest documents into a searchable index or knowledge base, retrieve top-ranked evidence passages for each user query, and pass those excerpts into the language model prompt to synthesize a grounded response with citations.78
- 7Retrieval Augmented Generation (RAG) in Azure AI SearchMicrosoft Learn ↗
- 8Retrieve Data and Generate AI Responses with Amazon Bedrock Knowledge BasesAmazon Web Services (AWS) ↗
Why Retrieval and Generation Are Evaluated Separately
A RAG system can fail at two distinct stages: the retriever may miss relevant or current documents, or the generator may ignore or distort the retrieved evidence (hallucination).57 Consequently, evaluation frameworks separate retrieval metrics (relevance, recall, freshness) from generation metrics (faithfulness to retrieved context and answer correctness).5
- 5Retrieval-Augmented Generation for Large Language Models: A Survey (Gao et al.)arXiv ↗
- 7Retrieval Augmented Generation (RAG) in Azure AI SearchMicrosoft Learn ↗
Accuracy numbers reported across different research papers cannot be directly compared without matching datasets and evaluation setups, and production deployments must independently verify document access-control enforcement and index update latency.578
- 5Retrieval-Augmented Generation for Large Language Models: A Survey (Gao et al.)arXiv ↗
- 7Retrieval Augmented Generation (RAG) in Azure AI SearchMicrosoft Learn ↗
- 8Retrieve Data and Generate AI Responses with Amazon Bedrock Knowledge BasesAmazon Web Services (AWS) ↗
Frequently asked questions
- What does RAG retrieve and how does it shape the model's answer?
- A retriever searches an external index or knowledge base for passages relevant to the user's query and passes them into the language model's context so the model generates a response grounded in those sources.178
- Why are retrieval quality and answer accuracy evaluated separately in RAG?
- An error can occur either because the retriever failed to fetch the right or current documents, or because the language model hallucinated despite having the right context.57
Quotable sentences
Lewis et al. (May 22, 2020) introduced RAG by combining a pretrained generative model with a dense vector index (DPR), comparing sequence-level and token-level document conditioning.
12Later RAG research introduced training-free in-context prompting (2023), self-reflective retrieval/critique in Self-RAG (2023), and corpus-graph summarization in GraphRAG (2024).
346Cloud platforms including Azure AI Search and Amazon Bedrock Knowledge Bases implement RAG by indexing enterprise data and injecting retrieved passages into LLM prompts.
78RAG evaluation separates retrieval quality (relevance and freshness) from generation faithfulness (whether the output matches retrieved evidence).
57
Timeline
- Karpukhin et al. release Dense Passage Retrieval (DPR, arXiv:2004.04906).2
- Lewis et al. introduce Retrieval-Augmented Generation (RAG, arXiv:2005.11401).1
- Ram et al. publish In-Context Retrieval-Augmented Language Models (arXiv:2302.00083).3
- Asai et al. introduce Self-RAG with adaptive retrieval and self-reflection (arXiv:2310.11511).4
- Edge et al. publish GraphRAG for query-focused summarization over document graphs (arXiv:2404.16130).6
Sources
Academic and news
- 1Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al.) · arXiv · published 2020-05-22 · checked 2026-12-04https://arxiv.org/abs/2005.11401
- 2Dense Passage Retrieval for Open-Domain Question Answering (Karpukhin et al.) · arXiv · published 2020-04-10 · checked 2026-12-04https://arxiv.org/abs/2004.04906
- 3In-Context Retrieval-Augmented Language Models (Ram et al.) · arXiv · published 2023-01-31 · checked 2026-12-04https://arxiv.org/abs/2302.00083
- 4Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection (Asai et al.) · arXiv · published 2023-10-17 · checked 2026-12-04https://arxiv.org/abs/2310.11511
- 5Retrieval-Augmented Generation for Large Language Models: A Survey (Gao et al.) · arXiv · published 2023-12-18 · checked 2026-12-04https://arxiv.org/abs/2312.10997
- 6From Local to Global: A Graph RAG Approach to Query-Focused Summarization (Edge et al.) · arXiv · published 2024-04-24 · checked 2026-12-04https://arxiv.org/abs/2404.16130
Official sites
- 7Retrieval Augmented Generation (RAG) in Azure AI Search · Microsoft Learn · published 2026-11-17 · checked 2026-12-04https://learn.microsoft.com/en-us/azure/search/retrieval-augmented-generation-overview
- 8Retrieve Data and Generate AI Responses with Amazon Bedrock Knowledge Bases · Amazon Web Services (AWS) · published 2026-01-01 · checked 2026-12-04https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html
Review and writing
Expert review pending
When a credentialed expert reviews this page, the reviewer's name and the review date appear here. (Current version 2fbd34f9)
How this page was written
Written automatically from the public information in the sources above.
Version
2fbd34f940b14c4117b2b28e1d7cf76d7eed749a00bbca7da0f856d736e6e342
Each edit gives the page a new version number.
Mimirwiki. "Retrieval-Augmented Generation (RAG)." Version 2fbd34f9, 2026-12-04. https://mimirwiki.com/wiki/retrieval-augmented-generation
# Markdown curl https://mimirwiki.com/wiki/retrieval-augmented-generation.md # JSON-LD, by content negotiation curl -H "Accept: application/ld+json" \ https://mimirwiki.com/wiki/retrieval-augmented-generation
Add an extension to the address to get the same content in that format.