All episodes
Memory & KnowledgeEpisode 8

RAG

RAG: Giving AI an Open-Book Exam

8 min listen

Episode 8: RAG
0:008:08

Welcome back to the NEXUS AI Literacy Series. The last two episodes set up a problem and half a solution. We learned the model has a limited desk — the context window. And we learned about vector databases that can search a massive library by meaning. This episode is where those two ideas snap together into the single most important and widely-used pattern in practical AI today. It has an unfortunately clunky name — Retrieval Augmented Generation — but everyone just calls it RAG. If you remember one acronym from this whole series, make it this one, because RAG is how businesses actually put AI to work on their own information. By the end, you'll understand exactly what it is, why it's so powerful, and where it falls down.

Let me start with the problem RAG solves, because it's a big one. Think back to Episode 4: a model only knows what was in its training data, up to its knowledge cutoff. That means, out of the box, a language model knows nothing about your company. It's never seen your internal documents, your product manuals, your customer history, last week's meeting notes, today's inventory. It's brilliant and well-read in general, but it knows literally nothing about your specific world. So if you ask a raw model "what's our refund policy?" it has two bad options: admit it doesn't know, or — worse — make up something plausible-sounding. Neither is useful, and the second is dangerous.

So how do we give a model access to private, specific, or up-to-the-minute information it was never trained on? You might think: just retrain it on our documents. But that's enormously expensive, slow, and you'd have to redo it every time a document changes. Completely impractical for information that updates daily.

RAG is the elegant answer, and the core idea is captured perfectly by one analogy: RAG turns a closed-book exam into an open-book exam.

Think about the difference. A closed-book exam forces you to answer purely from memory — whatever's already in your head. That's a raw language model: it answers only from what it absorbed during training. An open-book exam is completely different. You don't have to have memorized everything. When a question comes up, you look up the relevant page in your textbook, read it, and answer based on what's right there in front of you. You're still the one reasoning and writing the answer — but now your answer is grounded in the actual source material, not just your memory. RAG gives the AI an open book.

Now let me walk you through how it actually works, step by step, because it's wonderfully logical and it uses everything we've built so far. Say an employee asks the company AI: "What's our parental leave policy?"

Step one — retrieval. Before the model answers, the system takes that question and runs a semantic search against the company's vector database — all those internal documents we stored by meaning back in Episode 7. It finds the handful of chunks most relevant to parental leave: probably a few paragraphs from the HR handbook. That's the "retrieval" in Retrieval Augmented Generation.

Step two — augmentation. Now the system does something clever and a little sneaky. It takes those retrieved paragraphs and quietly places them onto the model's desk — into the context window — right alongside the user's question. Essentially it constructs a hidden, expanded prompt that says: "Here are the relevant policy documents. Now, using these, answer the question: what's our parental leave policy?" That's the "augmentation" — we augmented the question with the right reference material. The user never sees this assembly happening; they just asked a simple question.

Step three — generation. Now the model does what it's great at: it reads the question and the provided documents sitting in its context, and it generates a clear, natural-language answer grounded in those actual paragraphs. That's the "generation." The result: an accurate, specific answer about your company's real policy — from a model that, moments ago, knew nothing about your company.

Retrieve, augment, generate. That's the whole pattern. And once you see it, you'll notice it's behind a huge amount of the AI you encounter — the customer-support bot that actually knows the product, the tool that answers questions about your uploaded PDF, the assistant that can cite this morning's data. Almost all of it is RAG under the hood.

Now let me give you the three big reasons RAG won, because this is what makes you sound sharp about why it's everywhere.

First, it's current. Update a document in the database and the AI's answers update instantly — no retraining. The open book can be swapped out anytime.

Second — and this is huge — it can cite its sources. Because the answer is built from specific retrieved documents, the system can show you exactly which ones. That gives you something a raw model can't: the ability to check the work. We'll see in a second why that matters enormously.

Third, it dramatically reduces made-up answers. Instead of pulling from hazy memory, the model is answering from documents placed right in front of it. Grounding the model in real source material is one of the best defenses we have against the model just inventing things — which, not coincidentally, is the entire subject of our next episode.

But — and you know the drill — RAG is not magic, and the honest limitations are exactly where the real expertise lives. Here's the key one: RAG is only as good as its retrieval. Think about the open-book exam again. If you flip to the wrong page, you'll confidently write a wrong answer based on irrelevant material. Same with RAG. If that first semantic search pulls the wrong documents — or misses the right one — the model will generate a fluent, confident answer based on the wrong source. And it'll sound just as authoritative as a correct one. So an enormous amount of the real engineering in these systems isn't the AI at all — it's making retrieval excellent: chunking documents the right way, building good embeddings, tuning the search so the right pages land on the desk. When a RAG system gives a bad answer, the culprit is usually retrieval, not the model. It grabbed the wrong page.

A second limitation: RAG can only find answers that actually exist in the documents. If the policy was never written down, no amount of searching will find it, and a poorly-built system might then fall back on guessing. And third, it adds moving parts — the vector database, the search step, the document pipeline — all of which have to be maintained and kept fresh. RAG is powerful, but it's a system to be engineered, not a switch you flip.

So let's bring it home. A raw model knows nothing about your private, specific, or current information — it's taking a closed-book exam from memory. RAG turns it into an open-book exam: when a question comes in, it retrieves the most relevant documents from a vector database, augments the prompt by placing them on the model's desk, and lets the model generate an answer grounded in that real source material. Retrieve, augment, generate. It's how AI gets to work on your actual data — current, citable, and far less prone to making things up. And its great weakness is simple: if retrieval grabs the wrong page, you get a confident wrong answer, which is why great RAG is really about great retrieval.

So when someone says "we're building a RAG system," you now know exactly what they mean: they're giving an AI an open book of their own documents, so it can answer questions about their world instead of just the world it was trained on.

In the next episode, we confront the elephant in the room — hallucinations. Why do these models sometimes state complete fabrications with total confidence? It's not a random glitch; it's a direct, almost inevitable consequence of how they work — and understanding it is the difference between using AI wisely and getting burned. See you there.

Want AI like this working inside your business?

Talk to AImpact Nexus