RAG
Also called Retrieval-augmented generation
Retrieval-augmented generation combines a generative model with information retrieved at query time from an external collection. The retrieved material is supplied as context for the response instead of asking the model to rely only on information encoded in its parameters.
[Lewis et al.][LangChain]In practice · hypothetical example
Hypothetical worked example: a museum assistant receives the question, "Which gallery is showing the 1912 landscape this week?" The application searches its catalog and current-exhibition records, retrieves the passage naming the painting and gallery, and supplies that passage to the language model. The model then drafts an answer such as "The 1912 landscape is in Gallery 3 this week, according to the current-exhibition record," with a link or citation to the retrieved record. If retrieval returns an old catalog entry instead of the current schedule, the assistant may produce an outdated answer; checking the record's date and showing the evidence are therefore important parts of this hypothetical workflow.
[LangChain][Lewis et al.]A little deeper
A typical RAG flow first represents documents in a searchable collection, retrieves passages relevant to a user's question, and gives those passages to a language model that generates the answer. A common implementation splits documents into chunks, creates embeddings, stores them in a vector store, embeds the query, and passes the retrieved documents to the model. The original RAG paper describes a pretrained sequence-to-sequence generator paired with a neural retriever over a dense vector index of Wikipedia; it compares conditioning on the same passages for the whole answer with selecting passages per generated token. [Lewis et al.][LangChain]
RAG is useful when an application needs answers grounded in a document collection or other external knowledge at request time. The original paper evaluates RAG on knowledge-intensive language tasks, including open-domain question answering. In application documentation, retrieve-then-generate flows are presented for FAQs and documentation bots, and can connect to an existing SQL database, document database, CRM, or internal documentation system rather than requiring that data to be rebuilt as a new knowledge base. [Lewis et al.][LangChain]
Retrieval changes what information is supplied to the model; it does not by itself guarantee that the retrieved passages are relevant, complete, current, or correctly interpreted. The original paper identifies provenance and updating a model's world knowledge as open problems, while retrieval documentation recommends evaluating retrieval quality as well as answer correctness, relevance, and groundedness. A RAG system therefore needs suitable source data and checks appropriate to its use case. [Lewis et al.][LangChain]
A common mix-up
Using RAG guarantees a correct answer because the model has been given sources.
RAG supplies retrieved context, but retrieval can miss relevant information and generation can still produce an incorrect or insufficiently supported answer. The source collection, retrieval result, and final answer need checks appropriate to the application. [Lewis et al.][LangChain]
RAG is the same as fine-tuning the model on the retrieved documents.
In the retrieve-then-generate pattern, documents are fetched and supplied as context at request time. That is different from changing model parameters through training; the RAG paper describes the retrieved collection as non-parametric memory paired with a pretrained generator. [Lewis et al.][LangChain]
Similar terms, different emphasis
Compare RAG & Fine-tuning →An assistant searches a current exhibition record, supplies the retrieved passage to a language model, and drafts an answer. Which statement best describes this pattern?
Sources & editorial notes
Evidence: supported. Primary-paper support for the original RAG formulation, supplemented by first-party framework documentation for a current retrieve-to-generate pipeline and its evaluation considerations; the project owner reviewed revision 3 against the rag-paper and retrieval-docs locators and approved it on 2026-09-17.
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks ↗ (opens in new tab)Lewis et al. · Publication date unknown
Relevant section: Abstract - Retrieval ↗ (opens in new tab)LangChain · Publication date unknown
Relevant section: From retrieval to RAG; Retrieval pipeline
Last editorial review: 2026-09-17 by project-owner.
First observed in this corpus: Unknown.
Revision history
Revision 4 · Created 2026-09-13 · Updated 2026-09-17
Project owner approved the current content for publication. Existing evidence scope and limitations remain applicable.
Project owner approved the SEO-12 RAG expansion (mechanism, use cases, limitations, hypothetical worked example, misconceptions, and quiz) as revision 4 after checking claims against the rag-paper and retrieval-docs locators.