What is RAG (Retrieval Augmented Generation)?
A technique that enhances language model responses by retrieving relevant documents from an external knowledge base before generating an answer.
Retrieval Augmented Generation (RAG) combines information retrieval with text generation to produce answers grounded in specific source material. When a query arrives, a retrieval component searches a vector database or document index for passages most relevant to the query. These passages are then injected into the model's context window alongside the original question, giving the model factual grounding it would not otherwise have. RAG reduces hallucination, enables models to reference up-to-date or proprietary information, and provides a natural citation mechanism. Effective RAG systems require careful attention to chunking strategies, embedding quality, and context window budgeting.