RAG (Retrieval-Augmented Generation)
Last Updated: July 29, 2026 | By Mihail Sebastian | AI Dictionary
A technique where a language model retrieves documents from an external source and grounds its answer in them instead of relying on memory alone.
What is RAG (Retrieval-Augmented Generation)?
Retrieval-augmented generation (RAG) is a technique in which a language model retrieves relevant documents from an external source and uses them as context when writing its answer. Instead of answering from whatever it absorbed in training, a RAG system answers from evidence it looked up seconds ago.
That makes RAG the standard mitigation for hallucination: answers trace back to real sources, and the knowledge base stays current without retraining the model.
How RAG Works
A RAG pipeline runs in three steps. First, the user’s question is converted into a numerical vector (a word embedding) and matched against a pre-indexed knowledge base – company documents, manuals, a wiki. Second, the best-matching passages are inserted into the model’s prompt alongside the question.
Third, the model writes its answer with those passages in view, and the system attaches citations that show which source supports each claim.
This differs from fine-tuning, which bakes new knowledge into the model’s weights. RAG adds knowledge at query time: update the documents and the next answer reflects the change, with no training run.
Applications of RAG
- Customer support: assistants that answer from product manuals and help-center articles rather than generic knowledge.
- Internal knowledge assistants: employees query policy documents, contracts, or engineering docs in plain language.
- Research and legal work: question answering over large document sets where every claim must trace back to a source.
Example of RAG
An insurance company builds a support chatbot. A customer asks whether water damage from a burst pipe is covered. The retriever searches that customer’s policy documents and pulls the clauses on water damage.
Those clauses go into the prompt, and the model writes an answer that quotes the relevant clause and links to it. Without retrieval, the model would answer from general knowledge of insurance policies – plausible, generic, and possibly wrong for this customer’s actual contract.
Related AI terms: Hallucination · Fine-tuning · Guardrails · Generative AI
Did you like the RAG (Retrieval-Augmented Generation) gist?
Learn about 250+ need-to-know artificial intelligence terms in the AI Dictionary.
Mihail Sebastian — Writes about AI governance, regulation, and the technology behind them. Placeholder bio — replace with a real credential line. About