# What is retrieval-augmented generation (RAG)?

Retrieval-augmented generation (RAG) fetches relevant documents from your data at request time and gives them to the model as context, grounding answers in your actual sources instead of the model’s memory. It reduces hallucination and keeps answers current without retraining the model.

RAG and fine-tuning solve different problems: RAG injects knowledge per request; fine-tuning changes behavior permanently. Production systems usually combine them, with a fine-tuned model reading retrieved context.

As context windows grow, simple RAG pipelines shrink: for bounded corpora it is often better to pass the whole document set than to retrieve fragments.

## Related terms

- [Fine-tuning](https://allocate.network/glossary/fine-tuning.md)
- [Context window](https://allocate.network/glossary/context-window.md)
- [Embeddings](https://allocate.network/glossary/embeddings.md)

---

[HTML page](https://allocate.network/glossary/rag) · [Machine-readable catalog](https://allocate.network/catalog.json)
