Learn
What is RAG (retrieval-augmented generation)?
Last reviewed July 16, 2026
RAG (retrieval-augmented generation) is the pattern of fetching relevant material at request time (from files, databases, or search) and placing it in the model's context before it answers. The model generates from what was retrieved rather than from training memory alone, which grounds answers in current, private, or citable sources and cuts hallucination on factual questions.
How the pipeline works
Three steps: index your sources (usually by splitting documents into chunks and computing embeddings), retrieve the chunks most relevant to the query, and generate with those chunks in context, ideally with citations back to the source. Retrieval quality decides answer quality: a perfect model given the wrong chunks produces a confident wrong answer.
When RAG beats the alternatives
RAG wins when knowledge changes often, exceeds any context window, or must stay access-controlled: you retrain nothing, just update the index. Long context windows shrink the need for small corpora (attach the documents directly); fine-tuning shapes behavior and style, not facts. In practice: attach when the corpus is small, retrieve when it is large, fine-tune rarely.
Attach Drive files or whole folders to a chat and idapt puts the relevant content in context; agents search your files and the web as tools, and subagents fan out across a large corpus.
Frequently asked
See it in practice
The fastest way to understand it is to use it. Start free, no credit card.
Try idapt free