{
  "schemaVersion": 1,
  "slug": "retrieval-augmented-generation",
  "locale": "en",
  "pageClass": "concept",
  "entityType": "DefinedTerm",
  "field": "technology",
  "title": "Retrieval-Augmented Generation (RAG)",
  "subtitle": "AI architecture that retrieves external documents to ground language model responses",
  "aliases": [
    "RAG",
    "Retrieval Augmented Generation"
  ],
  "lead": {
    "definition": "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.",
    "answerSummary": "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.",
    "keyFacts": [
      {
        "label": "Foundational Paper",
        "value": "Lewis et al., arXiv:2005.11401 (May 22, 2020)",
        "ref": "s1"
      },
      {
        "label": "Retriever Basis",
        "value": "Dense Passage Retrieval (DPR, April 2020)",
        "ref": "s2"
      },
      {
        "label": "Core Mechanism",
        "value": "Retrieve relevant chunks -> supply to generator",
        "ref": "s1"
      },
      {
        "label": "Key Variants",
        "value": "In-Context RAG, Self-RAG, GraphRAG",
        "ref": "s4"
      },
      {
        "label": "Cloud Platforms",
        "value": "Azure AI Search, Amazon Bedrock Knowledge Bases",
        "ref": "s7"
      },
      {
        "label": "Evaluation Principle",
        "value": "Measure retrieval quality & faithfulness separately",
        "ref": "s5"
      }
    ]
  },
  "infobox": [
    {
      "label": "Category",
      "value": "Natural language processing / AI architecture",
      "ref": "s5"
    },
    {
      "label": "Origin",
      "value": "Lewis et al. (2020)",
      "ref": "s1"
    },
    {
      "label": "Memory Types",
      "value": "Parametric (model weights) + non-parametric (index)",
      "ref": "s1"
    },
    {
      "label": "Prompting Approach",
      "value": "In-Context RALM (Ram et al., Jan 2023)",
      "ref": "s3"
    },
    {
      "label": "Self-Reflection",
      "value": "Self-RAG (Asai et al., Oct 2023)",
      "ref": "s4"
    },
    {
      "label": "Graph Extension",
      "value": "GraphRAG (Edge et al., Apr 2024)",
      "ref": "s6"
    }
  ],
  "sections": [
    {
      "id": "origins-and-mechanism",
      "heading": "Origins and Core Mechanism",
      "bodyMd": "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.[^s1] 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).[^s1][^s2]"
    },
    {
      "id": "evolution-and-variants",
      "heading": "Evolution: In-Context RAG, Self-RAG, and GraphRAG",
      "bodyMd": "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.[^s3]\n\nMore 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,[^s4] while **GraphRAG** (Edge et al., April 2024) extracts entity graphs and community summaries to answer global, corpus-wide queries.[^s6] Survey work (Gao et al., December 2023) categorizes these stages into Naive, Advanced, and Modular RAG.[^s5]"
    },
    {
      "id": "production-architectures",
      "heading": "Production Search Indexes and Knowledge Bases",
      "bodyMd": "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.[^s7][^s8]"
    },
    {
      "id": "evaluation-and-limits",
      "heading": "Why Retrieval and Generation Are Evaluated Separately",
      "bodyMd": "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).[^s5][^s7] Consequently, evaluation frameworks separate retrieval metrics (relevance, recall, freshness) from generation metrics (faithfulness to retrieved context and answer correctness).[^s5]\n\nAccuracy 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.[^s5][^s7][^s8]"
    }
  ],
  "faqs": [
    {
      "q": "What does RAG retrieve and how does it shape the model's answer?",
      "a": "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.",
      "refs": [
        "s1",
        "s7",
        "s8"
      ]
    },
    {
      "q": "Why are retrieval quality and answer accuracy evaluated separately in RAG?",
      "a": "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.",
      "refs": [
        "s5",
        "s7"
      ]
    },
    {
      "q": "How do In-Context RAG, Self-RAG, and GraphRAG differ?",
      "a": "In-Context RAG inserts retrieved text directly into prompts without retraining, Self-RAG lets the model decide when to retrieve and critique its output, and GraphRAG builds entity graphs for corpus-wide synthesis.",
      "refs": [
        "s3",
        "s4",
        "s6"
      ]
    },
    {
      "q": "Can RAG benchmark scores from different papers be compared directly?",
      "a": "No. Accuracy figures depend on the underlying corpus, retriever, generator, and evaluation protocol, and production systems must also verify permissions and index freshness.",
      "refs": [
        "s5",
        "s7"
      ]
    }
  ],
  "claims": [
    {
      "text": "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.",
      "refs": [
        "s1",
        "s2"
      ]
    },
    {
      "text": "Later RAG research introduced training-free in-context prompting (2023), self-reflective retrieval/critique in Self-RAG (2023), and corpus-graph summarization in GraphRAG (2024).",
      "refs": [
        "s3",
        "s4",
        "s6"
      ]
    },
    {
      "text": "Cloud platforms including Azure AI Search and Amazon Bedrock Knowledge Bases implement RAG by indexing enterprise data and injecting retrieved passages into LLM prompts.",
      "refs": [
        "s7",
        "s8"
      ]
    },
    {
      "text": "RAG evaluation separates retrieval quality (relevance and freshness) from generation faithfulness (whether the output matches retrieved evidence).",
      "refs": [
        "s5",
        "s7"
      ]
    }
  ],
  "timeline": [
    {
      "date": "2020-04-10",
      "text": "Karpukhin et al. release Dense Passage Retrieval (DPR, arXiv:2004.04906).",
      "refs": [
        "s2"
      ]
    },
    {
      "date": "2020-05-22",
      "text": "Lewis et al. introduce Retrieval-Augmented Generation (RAG, arXiv:2005.11401).",
      "refs": [
        "s1"
      ]
    },
    {
      "date": "2023-01-31",
      "text": "Ram et al. publish In-Context Retrieval-Augmented Language Models (arXiv:2302.00083).",
      "refs": [
        "s3"
      ]
    },
    {
      "date": "2023-10-17",
      "text": "Asai et al. introduce Self-RAG with adaptive retrieval and self-reflection (arXiv:2310.11511).",
      "refs": [
        "s4"
      ]
    },
    {
      "date": "2024-04-24",
      "text": "Edge et al. publish GraphRAG for query-focused summarization over document graphs (arXiv:2404.16130).",
      "refs": [
        "s6"
      ]
    }
  ],
  "sources": [
    {
      "key": "s1",
      "url": "https://arxiv.org/abs/2005.11401",
      "tier": 2,
      "title": "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al.)",
      "publisher": "arXiv",
      "publishedAt": "2020-05-22",
      "accessedAt": "2026-12-04"
    },
    {
      "key": "s2",
      "url": "https://arxiv.org/abs/2004.04906",
      "tier": 2,
      "title": "Dense Passage Retrieval for Open-Domain Question Answering (Karpukhin et al.)",
      "publisher": "arXiv",
      "publishedAt": "2020-04-10",
      "accessedAt": "2026-12-04"
    },
    {
      "key": "s3",
      "url": "https://arxiv.org/abs/2302.00083",
      "tier": 2,
      "title": "In-Context Retrieval-Augmented Language Models (Ram et al.)",
      "publisher": "arXiv",
      "publishedAt": "2023-01-31",
      "accessedAt": "2026-12-04"
    },
    {
      "key": "s4",
      "url": "https://arxiv.org/abs/2310.11511",
      "tier": 2,
      "title": "Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection (Asai et al.)",
      "publisher": "arXiv",
      "publishedAt": "2023-10-17",
      "accessedAt": "2026-12-04"
    },
    {
      "key": "s5",
      "url": "https://arxiv.org/abs/2312.10997",
      "tier": 2,
      "title": "Retrieval-Augmented Generation for Large Language Models: A Survey (Gao et al.)",
      "publisher": "arXiv",
      "publishedAt": "2023-12-18",
      "accessedAt": "2026-12-04"
    },
    {
      "key": "s6",
      "url": "https://arxiv.org/abs/2404.16130",
      "tier": 2,
      "title": "From Local to Global: A Graph RAG Approach to Query-Focused Summarization (Edge et al.)",
      "publisher": "arXiv",
      "publishedAt": "2024-04-24",
      "accessedAt": "2026-12-04"
    },
    {
      "key": "s7",
      "url": "https://learn.microsoft.com/en-us/azure/search/retrieval-augmented-generation-overview",
      "tier": 3,
      "title": "Retrieval Augmented Generation (RAG) in Azure AI Search",
      "publisher": "Microsoft Learn",
      "publishedAt": "2026-11-17",
      "accessedAt": "2026-12-04"
    },
    {
      "key": "s8",
      "url": "https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html",
      "tier": 3,
      "title": "Retrieve Data and Generate AI Responses with Amazon Bedrock Knowledge Bases",
      "publisher": "Amazon Web Services (AWS)",
      "publishedAt": "2026-01-01",
      "accessedAt": "2026-12-04"
    }
  ],
  "links": [
    {
      "predicate": "related_to",
      "toSlug": "model-context-protocol",
      "label": "Model Context Protocol"
    },
    {
      "predicate": "related_to",
      "toSlug": "generative-engine-optimization",
      "label": "Generative Engine Optimization"
    }
  ],
  "sameAs": [
    "https://arxiv.org/abs/2005.11401"
  ],
  "disclaimer": null,
  "status": {
    "review": "awaiting_review",
    "provenance": "prefill",
    "autoWritten": true
  },
  "dateCreated": "2026-12-04",
  "dateModified": "2026-12-04",
  "_meta": {
    "canonicalUrl": "https://mimirwiki.com/wiki/retrieval-augmented-generation",
    "revision": {
      "sha256": "2fbd34f940b14c4117b2b28e1d7cf76d7eed749a00bbca7da0f856d736e6e342",
      "short": "2fbd34f9",
      "hashedFields": "all fields except status and _meta, RFC 8785 canonical form"
    },
    "formats": {
      "md": "https://mimirwiki.com/wiki/retrieval-augmented-generation.md",
      "txt": "https://mimirwiki.com/wiki/retrieval-augmented-generation.txt",
      "json": "https://mimirwiki.com/wiki/retrieval-augmented-generation.json",
      "jsonld": "https://mimirwiki.com/wiki/retrieval-augmented-generation.jsonld"
    },
    "translations": {
      "en": "https://mimirwiki.com/wiki/retrieval-augmented-generation",
      "ko": "https://mimirwiki.com/ko/wiki/retrieval-augmented-generation",
      "ja": "https://mimirwiki.com/ja/wiki/retrieval-augmented-generation",
      "zh": "https://mimirwiki.com/zh/wiki/retrieval-augmented-generation",
      "es": "https://mimirwiki.com/es/wiki/retrieval-augmented-generation",
      "de": "https://mimirwiki.com/de/wiki/retrieval-augmented-generation",
      "fr": "https://mimirwiki.com/fr/wiki/retrieval-augmented-generation",
      "pt": "https://mimirwiki.com/pt/wiki/retrieval-augmented-generation",
      "ru": "https://mimirwiki.com/ru/wiki/retrieval-augmented-generation",
      "it": "https://mimirwiki.com/it/wiki/retrieval-augmented-generation",
      "hi": "https://mimirwiki.com/hi/wiki/retrieval-augmented-generation",
      "ar": "https://mimirwiki.com/ar/wiki/retrieval-augmented-generation"
    }
  }
}
