Skip to content

AI, decoded

What is RAG, and why do AI systems use it?

RAG, retrieval-augmented generation, is a pattern where the system fetches relevant documents at query time and hands them to the model along with the question, so the answer is grounded in real sources instead of the model's memory. It exists to fix two problems with a bare language model: it doesn't know your private or current data, and it makes things up when it doesn't know. RAG gives the model the right context to read before it answers.

· Updated · Chain of Thought

Level 2: Using AI well · 2.2 Give it the right context

RAG & Retrieval

  • 1 episode
  • 2 guest clips
  • 8 glossary terms
An open book with one highlighted line, beside the words: open book. The model reads before it answers.

In detail

The problem RAG solves

On its own, a language model only knows what it saw in training. It can’t see your company’s documents, last week’s data, or anything behind your login. Ask it about those and it will either refuse or, worse, invent a confident answer. RAG closes that gap by giving the model the source material at the moment you ask. Assistants that seem to know your files or this week’s news often use retrieval behind the scenes. Van Luijt described RAG’s spread in episode 8 at 13:41 as reaching the early majority: an ordinary developer at an enterprise gets an assignment and realizes it can be solved with RAG.

How it works

Three steps. First, your documents are split into chunks and turned into embeddings, numerical representations stored in a vector database. Second, when a question comes in, the system embeds it too and retrieves the chunks closest in meaning. Third, those chunks are added to the prompt, and the model answers using them. The model isn’t recalling the answer; it’s reading it.

Where the idea comes from

The name comes from a 2020 paper by Patrick Lewis and colleagues at Facebook AI Research, Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. It paired a pre-trained generator with a retriever over a dense vector index of Wikipedia, and argued that knowledge stored only in a model’s parameters is hard to update and hard to trace back to a source. With retrieval added, their models set new results on three open-domain question-answering tasks and generated more specific and factual text than the same generator without retrieval. Production RAG systems today are looser than that paper’s design (many bolt a retriever onto an off-the-shelf model rather than training the two together), but the motivation is the same.

Why it beats fine-tuning for fresh knowledge

Teaching a model new facts by fine-tuning is slow, expensive, and goes stale the moment the data changes. RAG keeps knowledge in a store you can update any time — add a document and the next query can use it, no retraining. That makes it the default way to put current, private, or fast-changing information in front of a model. Fine-tuning still has a place for teaching a format, a tone or a narrow skill; fine-tuning vs. RAG vs. prompting walks through when each one fits.

Where it falls short

RAG is only as good as what it retrieves. If the search returns the wrong chunks, the model answers from bad context, and a grounded-looking answer can still be wrong. That’s why retrieval quality, not just the model, decides whether a RAG system works — and why evaluating the retrieval step separately matters. Weaviate co-founder Bob van Luijt gives a concrete failure in episode 8 at 25:34: ask for a company’s Q2 revenue, and the right chunk may be a PDF page that never names the company in its text; the only clue is a logo. A retriever that sees only the text cannot connect that chunk to the question.

The common fixes target the retrieval step. Hybrid search combines keyword and vector matching so exact names and codes aren’t lost, and a reranker re-scores the top results before they reach the model. On the generation side, faithfulness checks catch answers that go beyond what the retrieved text says. How to evaluate a RAG system covers measuring both halves, and agentic RAG vs. traditional RAG covers systems that let an agent decide when and what to retrieve.

Disclosure: Episode 8 aired while Chain of Thought was Galileo’s podcast and Conor worked there; it includes a Galileo ad read at 22:30.

RAG: an open-book exam for the model Left, a closed book: a bare model knows only what it saw in training. It cannot see your company's documents, last week's data or anything behind a login, so it refuses or invents a confident answer. Right, an open book, in three steps: your documents are split into chunks and stored as embeddings in a vector database; the question is embedded and the closest chunks are retrieved; the chunks go into the prompt and the model answers by reading them. Once a new document is indexed, the next query can use it, with no retraining. Underneath: RAG is only as good as what it retrieves. Weaviate's Bob van Luijt's example from episode 8: in a page of Apple's revenue figures, the only thing that says it is Apple might be the logo in the top corner, so embedding only the text can lose it. Closed book, open book RAG hands the model the source material at the moment you ask. It reads the answer instead of recalling it. A BARE MODEL training data It can’t see your company’s documents, last week’s data, or anything behind your login. So it refuses, or worse, invents a confident answer. WITH RAG · THREE STEPS 1 Store documents → chunks → embeddings in a vector database 2 Retrieve the question, embedded too the chunks closest in meaning 3 Read, then answer question + chunks model New document indexed? Next query can use it. Only as good as what it retrieves. Bob van Luijt’s example (episode 8): a page of Apple’s revenue numbers where the only thing that might say “Apple” is the logo in the corner. Embed only the text and that link can be lost. Wrong chunks in, grounded-looking wrong answer out. Evaluate retrieval on its own. maybe the only “Apple” is an image
The model reads the answer instead of recalling it, and retrieval quality decides whether it works. The Apple revenue-page example is Weaviate’s Bob van Luijt, episode 8. Download the image

Hear it from the guest

“Then if I look at that single PDF, the only way that I might able to recognize that it's Apple is that it has the little Apple logo in the top.”
“Just … random developer at, Enterprise X gets an assignment. I think, hey, wait a second, I can solve this with RAG.”

Quotes lightly edited to remove filler words.

Go deeper

From the conversation

This explainer is drawn from these episodes — each carries its full transcript.

Concepts in this explainer

Vector DatabaseRetrieval-Augmented Generation (RAG)GraphRAGGroundingKnowledge CutoffQuery DecompositionSemantic SearchEmbeddings