Retrieval-augmented generation (RAG) is a technique where an AI system first searches a set of documents for relevant information, then uses it to write a grounded answer. Instead of relying only on what the model memorised in training, it retrieves passages from sources such as a company handbook, a product database, research papers or the web.
How RAG works:
- Your question triggers a search of the document collection
- The most relevant passages are given to the model with your question
- The model writes its answer from that material, often with citations
Benefits of RAG:
- Answers can include up-to-date and private information
- Accuracy improves because the model works from real sources
- Users can check the citations
- It is often cheaper and more flexible than fine-tuning, since you just update the documents
You have probably used RAG already: whenever a chatbot searches the web and links sources, or a workplace assistant answers from internal documents. Its weak spot is the search step: if retrieval misses the right passage, the answer suffers.
Common questions
Why is RAG useful?
It lets AI answer from specific, up-to-date documents, such as a company's help pages, instead of only from training data. That makes answers more relevant and easier to check against the source.
Is RAG the same as web search?
They are related. Web search retrieves pages from the internet, while RAG usually retrieves from a chosen set of documents. Both feed relevant text to the model before it answers.