RAG (Retrieval-Augmented Generation)
A technique that combines a language model with real-time document retrieval to produce grounded, up-to-date answers.
What Is RAG (Retrieval-Augmented Generation)?
Retrieval-Augmented Generation (RAG) is an AI architecture that enhances large language models by retrieving relevant documents from an external knowledge base at query time, then using those documents as context when generating a response. Instead of relying solely on knowledge baked into the model weights during training, RAG systems can access private, proprietary, or recently-updated information.
A RAG pipeline typically consists of three stages: indexing (chunking documents and storing vector embeddings), retrieval (finding the most semantically relevant chunks for a given query), and generation (prompting the LLM with the retrieved context to produce an answer).
Why It Matters
RAG dramatically reduces AI hallucinations by grounding responses in retrieved facts. It also lets businesses deploy LLMs over internal knowledge bases — product documentation, legal contracts, support tickets — without retraining the model. This makes enterprise AI adoption far cheaper and more practical.
Real-World Examples
Customer Support Bot
A company indexes its help-center articles. When a customer asks a question, RAG retrieves the relevant article and the LLM summarizes the answer.
Legal Research Assistant