---
title: Retrieval-Augmented Generation (RAG) — AI Glossary
description: Retrieval-augmented generation combines a language model with an external retrieval step. Before generating, the system fetches relevant documents from a knowledge source and supplies them as context, so answers are grounded in specific, up-to-date data rather than relying solely on the model's parametric memory.
canonical: https://prompeteer.ai/glossary/retrieval-augmented-generation
---

# Retrieval-Augmented Generation (RAG)

Retrieval-augmented generation combines a language model with an external retrieval step. Before generating, the system fetches relevant documents from a knowledge source and supplies them as context, so answers are grounded in specific, up-to-date data rather than relying solely on the model's parametric memory.

## Definition

RAG separates knowledge from the model's weights. A retriever — usually powered by embeddings and a vector database — finds passages relevant to the query, and those passages are inserted into the prompt so the generator can cite and reason over them. This reduces hallucination, allows the knowledge base to be updated without retraining, and supports source attribution.

The pattern originates from work by Lewis et al., who paired a neural retriever with a sequence-to-sequence generator. Production RAG systems add chunking, reranking, and grounding checks to improve which passages reach the model and how faithfully it uses them.

## Sources

- [Lewis et al. (2020), Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://arxiv.org/abs/2005.11401)
- [Anthropic — Reducing hallucinations / grounding with context](https://docs.anthropic.com/en/docs/test-and-evaluate/strengthen-guardrails/reduce-hallucinations)

## Related terms

- [embedding](https://prompeteer.ai/glossary/embedding)
- [vector-database](https://prompeteer.ai/glossary/vector-database)
- [grounding](https://prompeteer.ai/glossary/grounding)
- [chunking](https://prompeteer.ai/glossary/chunking)
- [reranking](https://prompeteer.ai/glossary/reranking)
- [context-window](https://prompeteer.ai/glossary/context-window)
