Ask a model what a flight to Barcelona costs next Tuesday and you may get a confident, plausible, entirely useless answer.
Ask a model what a flight to Barcelona costs next Tuesday and you may get a confident, plausible, entirely useless answer. Not because it is careless, but because its knowledge stopped at the end of its training data, and flight prices were not in it.
This is the fundamental limit of a language model used on its own: it is a fixed store of knowledge. A person in the same position can look something up. A bare model cannot.
The fix is straightforward once you see it. Do not ask the model to remember. Go and find the information first, hand it over, and then ask the question. The model does the reading and the writing; something else does the looking up.
That pattern has a name, and you will meet it constantly: retrieval-augmented generation, usually shortened to RAG. Retrieve the material, augment the question with it, generate the answer.
Retrieval adds a research step before the model writes anything. Three stages:
The effect is that the answer rests on material that exists and can be checked, rather than on the model's recollection.
The ruling in the example below is invented for illustration and does not refer to a real decision. The point is only to show the difference between a generic answer and a grounded one.
Without retrieval. “What is the latest ruling on data privacy law?” → “Data privacy laws focus on protecting user data, with regulations such as GDPR and CCPA.” Generic, and possibly out of date.
With retrieval. The system searches a legal database, finds recent decisions, and answers: “According to the ruling in [case] dated [date], amendments now require stricter encryption for cross-border transfers” — with a link to the source. Specific, grounded, and checkable by the reader.
That last property is the one that matters in professional use. An answer you can verify is worth far more than an answer that merely sounds authoritative.
A retrieval system needs somewhere to look, something that does the looking, and the model that writes the answer. Figure 7 shows how they fit together.
Where the material comes from. It might be:
The component that finds the right material before the model is asked anything. It works in one of a few ways:
The retriever is where most of these systems succeed or fail. A strong model given the wrong three paragraphs will produce a confident wrong answer. Retrieval quality is the ceiling on answer quality, and it is where the effort belongs.
The model then writes the answer from the retrieved material plus its own capability. Done well, this step:
Customer support. An assistant retrieves the answer from internal documentation instead of guessing, which cuts waiting time and keeps answers consistent with policy. A banking assistant pulls the specific overdraft terms for the customer's own account type rather than a general description.
Healthcare. Clinical tools retrieve current guidance and research before drafting anything for a clinician to review.
Legal and compliance. Retrieval over case law lets a system reference recent decisions rather than whatever happened to be in its training data.
Search itself. Tools such as Perplexity, and the search modes in Claude and ChatGPT, retrieve across sources and present a direct answer with citations instead of a list of links. Chapter 10 takes one of these apart.
Our travel assistant. This is the change that makes it useful at all. Rather than describing what flights to Barcelona are usually like, it queries the airline's own system and reports what is actually available on Tuesday, with the price attached.
A model that can look things up is a considerable step forward. It is still, though, only answering. It reports what Tuesday's flights cost; it does not compare them against your budget, notice that the cheap one lands too late for your meeting, or book anything. To cross that line it needs tools it can act through, somewhere to keep track of where it has got to, and a reason to keep going until the job is done. That is where an AI agent begins.