RAG stands for retrieval-augmented generation. It is an approach in which an application retrieves relevant information from an external source and supplies it to a generative model to help answer a question. It is useful when the answer depends on specific documents or updated records.
Last updated: 29 November 2026
How does retrieval-augmented generation work?
A typical system prepares documents for search, identifies relevant passages in response to a question, and supplies those passages as context to a model. The model then generates an answer. Retrieval can use keyword search, embeddings or a combination. Some systems also rank retrieved passages before generation.
Example: a business knowledge assistant
Imagine a short-stay business with check-in instructions, parking information and property policies. A RAG assistant could retrieve the policy for the correct property before drafting a response. It should cite the relevant document and flag missing information instead of inventing a rule. Keep property-specific information separated and verify that access is authorised.
RAG vs fine-tuning vs a long prompt
Fine-tuning changes a model’s learned parameters through additional training. RAG supplies selected information at inference time without necessarily changing model weights. For a small document, attaching it directly may be simpler than building a retrieval system. RAG becomes useful when a collection is large, frequently updated or requires controlled access.
How to start using RAG
Choose a small collection of approved, current documents. Remove duplicate and superseded versions, define who can read them and test representative questions against known answers. Use a tool that retrieves relevant passages and ideally displays references. Include questions with no answer in the collection to test whether the system admits uncertainty.
Risks and limitations of RAG
Retrieval may miss the right document, find outdated passages or return content that contains malicious instructions. The model may also misread the retrieved evidence. Apply access controls before retrieval, review source quality and test the complete system, not just the chatbot. RAG reduces some factual errors but does not guarantee accuracy.
Frequently asked questions
Does RAG require a vector database?
No. Keyword search, hybrid retrieval and other search methods can be used. The best approach depends on your document collection.
Is RAG the same as MCP?
No. RAG is a technique for retrieving information to support generation; MCP is a protocol for connecting applications to capabilities. They can be used together.
Further reading
See the technical reference and guidance for more information.