What is RAG?
Define RAG and understand the three core problems it solves for LLMs: outdated knowledge, hallucination reduction, and source attribution.
Learning Goals
- Define Retrieval-Augmented Generation.
- Identify the three core problems RAG solves.
- Explain the metaphor of "Parametric" vs. "Source" knowledge.
The Bridge Between Training and Reality
Large Language Models (LLMs) are like geniuses living in a room without windows. They have read everything in the world up to a certain date (their Training Cut-off), but they cannot see what is happening outside right now. If you ask them about your company's latest internal memo or yesterday's news, they will either guess or confidently lie.
Retrieval-Augmented Generation (RAG) is the bridge that connects these models to the real world. It allows the model to "look out the window" by searching a specific set of documents before it answers your question.
Think of RAG as giving an LLM an "Open Book" exam. Instead of relying on memory alone, it can consult a library of facts to provide an accurate answer.
What is RAG? Retrieval Augmented Generation Explained
Parametric vs. Source Knowledge
To understand RAG, we must distinguish between two types of knowledge in an AI system:
- Parametric Knowledge: This is "baked" into the model's weights during training. It represents the model's general intelligence and understanding of language. It is static and expensive to update.
- Source Knowledge: This is external data provided to the model at the moment you ask a question. This is dynamic, easy to update, and can be private to your organization.
RAG works by converting your private data into Source Knowledge.
The Core RAG Value Loop
- 1Step 1
When a user asks a question, the system first "retrieves" relevant documents from a private database.
- 2Step 2
The system "augments" the user's question by attaching the retrieved text to it.
- 3Step 3
The LLM "generates" an answer based only on the provided context, ensuring the output is grounded in facts.
Knowledge Check
What does the 'R' in RAG stand for?