What is retrieval-augmented generation (RAG)?
Retrieval-augmented generation (RAG) is a method in which an AI tool first finds relevant passages in your documents and then writes its answer from those passages.
Key takeaways
- RAG lets a model answer from your files, not only from its training data.
- It lowers invented answers, because the model writes from real source text.
- File upload features, NotebookLM and many company chatbots work this way.
How it works
Your documents are cut into passages and indexed. When you ask a question, the tool searches the index for the passages that match, puts them in the context window with your question, and asks the model to answer from them. Good tools also show which passages they used.
Example
A firm loads its 300-page policy manual into an AI assistant. An employee asks about the travel rule for contractors. The assistant finds the two matching sections and answers with a link to each one.
Why it matters
RAG is how you make a general model useful for your business facts with no retraining. It is the idea behind most products that let you chat with your documents.
Common mistake
RAG is only as good as the search step. If the tool fetches the wrong passage, the model writes a confident answer from the wrong text. Check the cited source.
Related terms
See all terms in the AI Encyclopedia, the numbers on the AI statistics pages, or build a prompt with the prompt builder.