← All questions
RAGEasy· RAG Fundamentals

What is Retrieval-Augmented Generation, and why do you...

RAG is the pattern of pulling relevant documents out of an external knowledge base and injecting them into the prompt before the model generates an answer, instead of trusting the model to already know the answer from training. It exists because plain LLMs have real, structural limits: their knowledge stops at a training cutoff, they generate fluent but wrong answers when the real information isn’t in their weights, and anything specific to your organization — internal policies, proprietary data — was never part of any public model’s training run.

The economic case matters as much as the accuracy case: updating a knowledge base is a matter of re-indexing a document, which takes minutes; retraining or fine-tuning a model to bake in new facts takes days and real compute cost. Ask a plain LLM about a company’s refund policy and it gives a generic, possibly wrong guess. Retrieve the actual policy text and inject it into the prompt, and the model answers from that grounded text instead of guessing — same model, dramatically different reliability.

Code playground (Python)