💡 Think of it like this:
Imagine you're a student writing an exam, but you're allowed to bring one textbook. Without that textbook, you'd have to answer purely from memory — and your memory has gaps and might be outdated. With it, you can flip to the exact page you need, read the relevant passage, and then write your answer. The answer is still yours, but it's grounded in accurate, current information.
That's what RAG does for AI. An LLM on its own can only answer from what it was trained on (its "memory"). RAG lets it retrieve real, up-to-date information from external sources before generating a response — so the answer is grounded in actual facts, not just training data.
NVIDIA Glossary: What is Retrieval-Augmented Generation (RAG)?
Retrieval-Augmented Generation (RAG) is an AI technique where an external data source is connected to a large language model (LLM) so it can generate domain-specific or up-to-date responses in real time.
The core problem RAG solves: LLMs are powerful, but their knowledge is frozen at their training cutoff. They don't know about your company's internal documents, yesterday's news, or your specific database. RAG bridges this gap by letting the model look things up before answering.
<aside> ⚠️
Why this matters: Without RAG, LLMs can "hallucinate" — they confidently generate answers that sound right but are factually wrong. RAG anchors responses in real data, dramatically reducing hallucinations.
</aside>
The RAG pipeline has three main phases:
Before RAG can retrieve anything, the external data needs to be prepared:
When a user asks a question: