---
title: RAG (Retrieval-Augmented Generation)
type: vocabulary
url: "https://www.envisioning.com/vocab/rag"
summary: "A framework that augments an LLM's generation by retrieving relevant documents from an external knowledge source and conditioning the output on them."
year: 2020
generality: 0.70
---

# RAG (Retrieval-Augmented Generation)

A framework that augments an LLM's generation by retrieving relevant documents from an external knowledge source and conditioning the output on them.
Retrieval-Augmented Generation (RAG) is a framework introduced by Lewis et al. (Meta/Facebook AI, May 2020) that combines a parametric sequence-to-sequence generator (originally a BART-style model) with a non-parametric dense vector retriever that fetches relevant documents from an external knowledge source at inference time. Rather than relying solely on the parameters of a language model to encode world knowledge, RAG explicitly retrieves passages from a corpus (e.g., Wikipedia) and conditions the generator on them. This decouples knowledge storage from knowledge access: the corpus can be updated without retraining the model, and the model can cite its sources.

The canonical RAG architecture has two variants: RAG-Sequence, where the same retrieved document conditions the entire generated sequence, and RAG-Token, where a different document can condition each generated token. The retriever is typically a pre-trained dense passage retriever (DPR) based on BERT, and the generator is fine-tuned end-to-end with the retriever to maximize the marginal log-likelihood of the target sequence over retrieved documents. RAG builds directly on REALM (Guu et al., Feb 2020), which was the first end-to-end pretrained retrieval-augmented language model, and on earlier retrieve-then-read paradigms going back to DrQA (Chen et al., 2017).

RAG became the dominant pattern for grounding LLM outputs in external knowledge. Modern variants include Self-RAG (self-reflection on retrieved passages), GraphRAG (Microsoft, 2024; uses knowledge graphs instead of vector stores), Corrective RAG (CRAG, 2024), and hybrid approaches combining vector retrieval with knowledge-graph lookups. Recent agent memory systems like Mem0, MemOS, and Mandol extend RAG into long-term conversational settings where the retrieval target is the agent's own accumulated memory rather than a static corpus. RAG is foundational to `vector-database`, `retrieval`, `long-term-memory`, and `agentic-retrieval`.

---
Source: Envisioning — Technology Research Institute (https://www.envisioning.com/vocab/rag)
