# RAG: what it is and how it works · Zorraquino
> RAG combines the retrieval of external information with a generative model to produce answers based on relevant content.
URL: https://www.zorraquino.com/en/dictionary/rag

# RAG

RAG combines the retrieval of external information with a generative model to produce answers based on relevant content

What it means, how it is used and where it comes up, with its related concepts.

[The whole glossary](https://www.zorraquino.com/en/dictionary)

## What it is and how it works

The system searches for documents or passages and adds them to the context before generating. It can be used to query company documentation without retraining the model at every update. Its quality depends on the search, the sources and the answer. RAG can reduce certain errors, but it does not eliminate them or guarantee that a citation supports the claim.

Also known as

Retrieval-augmented generation

Topics

[Artificial intelligence](https://www.zorraquino.com/en/dictionary/category/inteligencia-artificial)

## Frequently asked questions about RAG

### When should you use RAG instead of fine-tuning a model with additional training?

RAG is usually appropriate when the answer needs to draw on external knowledge that changes or that must be traceable back to its documents. Fine-tuning through additional training changes the model's behavior and addresses different needs, although the two techniques can be combined. First identify whether the problem lies in having the right information or in how the answer is produced, and validate the option with tests.

### What documentation should you prepare before launching a RAG system?

Select documents that are current, understandable and have [identified owners](https://www.zorraquino.com/en/dictionary/data-governance), and resolve duplicates or conflicting versions. The system must respect what information each user is allowed to access during retrieval, not just hide it on the final screen. A large repository does not guarantee a good answer: the structure of the content, its boundaries and the ability to locate the relevant passage also matter.

### How can you tell a retrieval failure from a generation failure in RAG?

Review the retrieved documents and the generated answer separately. If the relevant information was missing, the problem may lie in coverage or in search. If the information was available and was misinterpreted, the generation needs to be reviewed. It is worth including questions the repository cannot answer: the system should acknowledge that gap rather than fill it with unsupported claims.

## Related concepts

- [Semantic search](https://www.zorraquino.com/en/dictionary/semantic-search)
- [Foundation model](https://www.zorraquino.com/en/dictionary/foundation-model)
- [Multimodal model](https://www.zorraquino.com/en/dictionary/multimodal-model)

## References

- [IBM: retrieval-augmented generation](https://www.ibm.com/think/topics/retrieval-augmented-generation)
- [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://arxiv.org/abs/2005.11401)
- [RAG and Generative AI — Azure AI Search](https://learn.microsoft.com/en-us/azure/search/retrieval-augmented-generation-overview)
- [The Government Data Quality Framework](https://www.gov.uk/government/publications/the-government-data-quality-framework/the-government-data-quality-framework)
