# Retrieval-Augmented Generation (RAG)

> First find the right pages, then let the model answer from them.

**Field:** Artificial Intelligence  
**Category:** Retrieval & Search  
**Also known as:** RAG, Retrieval Augmented Generation

## Think of it like

Think of it like an open-book test. You look up the right page, then you write the answer.

## Definition

Retrieval-augmented generation is a way to make a language model answer from your own documents. When a question comes in, a search finds the most relevant passages. Those passages are put into the prompt next to the question. The model then answers from that text and can point to its sources. It lets a model use private or fresh facts without any new training. The name comes from a 2020 research paper.

## Example

Lucy's company bot gets 'How many days of leave do I get?'. It finds the two paragraphs of the staff handbook about leave and answers from them, with a link to the page.

## Why it matters

It is the most common way to give an AI tool a company's own facts. It also cuts made-up answers.

## Common mistake

Blaming the model when answers are wrong. Most RAG failures come from the search step handing over the wrong text.

## Three principles

- **Search first.** Find the right passages.
- **Answer from them.** Text in the prompt.
- **No new training.** Facts stay current.

## Related terms

- [Chunking (RAG)](https://learn.benibix.com/term/ai/chunking)
- [Grounding (AI)](https://learn.benibix.com/term/ai/grounding)
- [Vector Database](https://learn.benibix.com/term/ai/vector-database)
- [Fine-Tuning](https://learn.benibix.com/term/ai/fine-tuning)
- [AI Search Engine](https://learn.benibix.com/term/ai/ai-search-engine)
- [Chat with Documents](https://learn.benibix.com/term/ai/chat-with-documents)
- [Knowledge Base (AI)](https://learn.benibix.com/term/ai/knowledge-base)

## Told apart from

- [RAG vs Fine-Tuning](https://learn.benibix.com/compare/retrieval-augmented-generation-vs-fine-tuning): People often think fine-tuning is how you teach a model your own documents. Fine-tuning changes how a model writes, and it is poor at adding facts that change. RAG leaves the model alone and hands it the right text at question time, so the facts stay current and can be traced. Use RAG for knowledge. Use fine-tuning for style and format.
- [RAG vs Semantic Search](https://learn.benibix.com/compare/rag-vs-semantic-search): People often think RAG is just semantic search. Semantic search only finds the passages that match a question by meaning. RAG is the whole system: a search finds the passages, then a language model reads them and writes the answer. The search inside RAG can be semantic, keyword or both.

## Taught in

- [Chat with Your Documents](https://learn.benibix.com/learn/ai-use-case/chat-with-your-documents): AI Assistants and Chatbots, 4/13

![A question goes to a search over the team's documents. The best passages and the question go into the language model together. The answer points back to its sources.](https://learn.benibix.com/diagrams/rt-rag.svg)

---

Source: https://learn.benibix.com/term/ai/retrieval-augmented-generation
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
