AI GLOSSARY · AI CONCEPTS
Retrieval-augmented generation (RAG)
Definition
Retrieval-augmented generation (RAG) is a method that retrieves relevant information from a knowledge base and adds it to the prompt of a generative model. The original paper paired a pretrained generator with a Wikipedia index.
Also called: RAG, retrieval augmented generation.
In plain language
An AI application can search a collection of documents for relevant information and add it to the prompt it sends to a model. Retrieval can fail to find the relevant information. In the original paper, the information in the search index could be updated when the system was run, while models that keep all their knowledge in their trained settings needed further training.
Technical definition
The original RAG paper combines a pretrained seq2seq generator with a dense vector index of Wikipedia accessed through a pretrained neural retriever, and describes a fine-tuning recipe in which retriever and generator are trained jointly. Anthropic describes a pipeline that breaks a knowledge base into chunks and adds the most relevant chunks to the prompt sent to the generative model; retrieval there combines embeddings and BM25.
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Guide · Illustrative, not executed
What Is RAG? Retrieval-Augmented Generation Explained
- What you see
- The guide includes a worked example on chunking and describes retrieving the closest chunks and placing them in the prompt.
- Why it exercises the concept
- A related guide in this almanac.
Skill by Skill Almanac · Illustrative, not executed
rag-chunking-planner 56/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- The catalog describes the skill as chunking documents by three strategies and measuring defects and offline recall.
- Why it exercises the concept
- A related tool, described by its catalog one-liner.
Skill by Skill Almanac · Illustrative, not executed
cited-deep-research 62/100 · grade CScored · Method v0.2 · How we score
- What you see
- The catalog describes the skill as running research so that every claim traces to a logged source and quote.
- Why it exercises the concept
- A related tool, described by its catalog one-liner.
How it shows up when you use agents
Consider a hypothetical knowledge base containing two passages: the library closes at 18:00, and the museum closes at 20:00. For a question about the library, retrieval selects the library passage and generation answers 18:00 using that passage. This illustration assumes successful retrieval and faithful generation; it is not a measured model result.
Replacing the library passage with a new closing time changes the system's available external evidence. It does not by itself change the generator's parameters. The original paper's index-updating experiment illustrates that distinction with different Wikipedia indexes.
Common confusions
- RAG versus a vector database. A vector database can supply storage and search for a RAG pipeline. RAG also conditions generation on the retrieved information. The cited Anthropic pipeline combines vector search with lexical BM25 retrieval.
- RAG versus fine-tuning. The original paper jointly fine-tunes a query encoder and generator and shows that its external retrieval index can be replaced at test time. Updating that index differs from changing knowledge encoded in model parameters. RAG and fine-tuning can be combined.
- Retrieval versus a correct result. Anthropic notes that a RAG system can fail to retrieve the relevant information from the knowledge base.
Related terms
Show all 57 related terms
Terms that mention Retrieval-augmented generation (RAG)
46 terms mention this one
- Agent memory
- Agentic RAG
- Agentic search
- AI search engine
- AnythingLLM
- BM25
- Chroma (vector database)
- Chunking
- Claude Projects
- Cohere
- Cosine similarity
- Cross-encoder
- Deep research (AI feature)
- Dify
- Embedding
- FAISS
- Fine-tuning
- Flowise
- GPT4All
- GraphRAG
- Hierarchical Navigable Small World (HNSW)
- Hybrid search
- Knowledge graph
- LangChain
- LlamaIndex
- LoRA (low-rank adaptation)
- Matryoshka embeddings
- Milvus
- NeMo Guardrails
- NotebookLM
- Perplexity (AI search)
- pgvector
- Pinecone (vector database)
- Precision and recall
- Prompt engineering
- Qdrant
- Question answering (QA)
- Semantic caching
- Semantic search
- Sentence Transformers
- Text-to-SQL
- TF-IDF
- Vector database
- Vector search
- Weaviate
- Web search tool
Guides that mention Retrieval-augmented generation (RAG)
More in AI concepts
Sources
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks — Lewis et al.; first submitted 2020, arXiv v4, 2021, arXiv (accessed 2026-11-24)
- Introducing Contextual Retrieval — 19 September 2024, Anthropic (accessed 2026-11-24)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude and Codex (automated drafting); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-24. Last verified .
Change log (19)
- : First version.
- : Pilot review (4 perspectives): document store and retraining glossed, everyday upload example added, limits and cost added, coding-agent analogy and chunking claim softened.
- : Initial reference entry with scoped definitions, primary references and illustrative examples.
- : Replaced with Codex's final reviewed version from the staged-approval cohort; earlier history kept above. Still a draft: not indexable.
- : Accuracy pass: rewrote short, plain and technical to what the cited arXiv and Anthropic pages state; removed unsupported claims about correctness, misinterpretation and vector databases.
- : Accuracy pass: narrowed 'supply selected results to a generator' to Anthropic's wording that relevant chunks are added to the prompt sent to the generative model.
- : Accuracy pass: replaced 'updating a document' with the paper's statement that knowledge can be updated at test time, while parametric-only models need further training.
- : Accuracy pass: replaced 'may not be relevant' with Anthropic's statement that the system can fail to retrieve the relevant information.
- : Accuracy pass: rag-chunking-planner example now uses the catalog one-liner (three strategies, defects, offline recall) instead of comparing supplied plans.
- : Accuracy pass: added Wikidata QID Q121362277 after confirming its English label and description match retrieval-augmented generation.
- : Accuracy pass: removed unsupported own-advice passages and example why-lines; the agents section is now marked as this entry's own explanation.
- : US spelling; per-example caveats removed (the page states once that examples are illustrative); related terms filled. No verified claim changed.
- : Separated retrieval storage from RAG and contextual, index and parameter updates; exact revision review pending.
- : Codex closed the four reported factual/example/link findings after source and rendered checks; owner approval and publication remain separate.
- : Codex internal correction check is recorded separately; independent review remains pending and is not implied by that check.
- : Codex bdaf816 patch applied (vector database and fine-tuning confusions rewritten). Verification reset to pending until Codex re-reviews this revision.
- : Round 7: plain section reworded without knowledge base, retrieval index, test time and parametric-only; technical wording unchanged.
- : Independent automated factual and example-source review completed; exact-version technical release checks recorded separately. Publication remains disabled.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.