Where Retrieval Enters the Turn
An employee asks an HR policy agent whether they can work from another country for six weeks. The agent says yes, with manager approval, and cites the remote-work policy. The handbook also caps work abroad at thirty days, in an appendix table that the index never turned into a passage. To the retriever the limit does not exist, and to a model answering from what the retriever returns, neither does the rule.
Thesis: Retrieval does not make the model know more. Your code before the call, a tool the model calls, or the provider's own search picks the few passages the model may read, so a miss looks to the model like a gap in the corpus unless the retriever admits it, and an answer that rests on the corpus is capped by what the retriever ranks; the passages that do arrive fill the window and ride every later call.
TLDR
Step 1 of 3
Where Retrieval Enters the Turn
An employee asks an HR agent about working abroad for six weeks.
The agent says yes: the thirty-day cap sat in an appendix table the index never made into a passage, so retrieval cannot find it.
Read the TLDR as text
- Where Retrieval Enters the Turn. An employee asks an HR agent about working abroad for six weeks. The agent says yes: the thirty-day cap sat in an appendix table the index never made into a passage, so retrieval cannot find it.
- What the Index Never Saw. Indexing cuts documents into chunks and drops text by design; tables often fall outside them, and the thirty-day limit sat in a table.
- A Miss Is Silent Unless the Retriever Says So. The model sees only ranked passages; one the retriever missed looks like one nobody wrote, so a missed exception gives a confident, cited, wrong answer.
What Training Puts in the Weights showed that your data is not in the model; this chapter opens the first stage of One Request, End to End's map at the part that decides which of your documents reach the call: retrieval.
Three Places the Stage Can Sit
Retrieval is a stage of the request, not a property of the model, and it runs in one of three places.
Before the call, your code queries a corpus and puts the winners into the call, usually in the user message (Anthropic's search results format is one way to mark them).
As a tool the model calls. The search_tickets tool from Anatomy of a Turn is this: the model writes a query, the harness runs it, the hits return as a tool result, and the request costs one more turn, one more model call. The Tool Call Is a Round Trip follows that round trip in detail.
Inside the provider. A provider-run search tool, such as OpenAI's file search over files you uploaded, ranks and inserts passages with no code on your end.
| Before the call | A tool the model calls | Inside the provider | |
|---|---|---|---|
| Who decides to retrieve | your code, every time | the model, by sampling a tool request | the model, in the provider's loop |
| Who ranks | your retriever | your retriever | the provider's |
| What the model sees | the passages | the passages, as a tool result | the passages, placed by the provider |
| Extra model calls | none | at least one | none visible to you |
| What you can log | query, ranks, ids | query, ranks, ids, the call | the citations; the hits only if the API returns them |
Three encodings, one mechanism: something outside the network chooses a handful of passages, and the network reads only those.
The three insert points, in the order a request reaches them. An agent may use one, two or all three.
sequenceDiagram
participant H as Your harness
participant R as Your retriever
participant P as Provider and model
Note over H,R: Before the call
H->>R: the ask, as a query
R-->>H: the top passages
H->>P: the call, passages in the user message
Note over H,P: A tool the model calls
P-->>H: a tool request with the model's query
H->>R: run the query
R-->>H: the top passages
H->>P: the passages as a tool result, call again
Note over P: Inside the provider
P->>P: its own search ranks passages into the window
P-->>H: the answer, with citations
Figure: Three places retrieval can happen. Your harness searches before the call and puts passages in the message; the model calls a search tool and gets passages back as a tool result; or the provider's own search ranks passages into the window and returns citations.
A Miss Is Silent Unless the Retriever Says So
The model sees the passages, not the ranking, the scores or the candidates below the cut. A passage the retriever did not rank is indistinguishable, from inside the window, from one nobody wrote. When the general rule arrives and the exception sat in a paragraph the retriever never reached, the answer is confident, cited and wrong.
A retriever can admit a miss. Set a relevance floor, mark results below it as weak, and return an explicit no-match when nothing clears it, rather than handing over the nearest passages anyway. A harness that returns the best k passages whatever their scores, k being the fixed number it always hands over, leaves the model treating k passages as the corpus. The admission has to reach the model as text, the only form it can act on: "no passage in the handbook matched this question" is something a model can repeat; a missing passage is not.
What the Index Never Saw
Before a retriever can rank a fact, an indexer has to have put that fact into something it can rank, and indexers drop text by design. Documents are cut into chunks, and each chunk is turned into one vector, a list of numbers standing for its meaning, by an embedding model, a separate and usually smaller model than the one that answers. The question's vector is compared with them, and the closest chunks win. Three common holes follow.
Truncation. Embedding models accept a fixed maximum input, and indexers stay under it by cutting, so a chunk or a whole-document vector can reflect only its opening. On this site, for one example, the site search's one vector per post embeds only the first 1,000 characters of each post's title, tags and text combined, so a figure from deep inside a long post is simply not in it.
Shape. Tables, footnotes, appendices and text in images often fall outside the chunker's idea of a passage, or land in a chunk whose other words say nothing about the question. The HR agent's thirty-day limit sat in a table.
Dilution. A chunk is scored as a whole. A fact in the second half of a long chunk is diluted by everything around it, and the chunk's vector says more about its main subject than about the one sentence that answers.
So the cap is concrete. A retriever can rank the right document and still be unable to supply the sentence that answers, because that sentence is in no unit it embedded. No change of answering model moves that. The fix is in the index.
The word embedding has two meanings in this series. Inside the answering model, each token is looked up in a table of vectors learned in training, the table What Training Puts in the Weights introduces, and Embeddings: How Vectors Get Meaning explains how such vectors come to carry meaning. The vectors in this chapter are the embedding model's, computed outside the answering model, stored in an index and compared by similarity; that same post covers how they are compared and what they cannot capture.
Tune It to What a Right Answer Is Worth
How many passages to fetch, and how hard to search for them, should follow from what a right answer is worth. The dials are k, the relevance floor and whether a weak first search earns a second. A person waiting on the HR agent needs a handful of passages in seconds, and can ask again if the answer looks wrong. The same agent re-reading what it told this employee last week, before answering a follow-up, needs every earlier exchange: a skipped one leaves nothing in the window to show it existed, so the model cannot notice it is gone.
Where It Hurts in an Enterprise
Back to the HR agent. Three consequences follow from the mechanism, and none of them is about the model.
The retrieved ids belong in the audit record. When the manager asks why the agent said yes, the useful log is the list of passages in the window at answer time, and the ones that were not. The citation is a claim about that list.
Apply access control before the window. A retriever that ranks a passage the asker may not read has already shown it to the model; permissions belong in the query, not in the prompt.
Passages are not read once. Ten chunks of 400 tokens are 4,000 tokens now and on every later call of the conversation unless the harness drops them.
Step 1 of 8
The ask
An employee asks an HR policy agent whether they can work from another country for six weeks.
Read this figure as text
Steps
- The ask: An employee asks an HR policy agent whether they can work from another country for six weeks.
- What the Index Never Saw: The handbook also caps work abroad at thirty days, in an appendix table that the index never turned into a passage.
- A Miss Is Silent Unless the Retriever Says So: The model sees the passages, not the ranking, the scores or the candidates below the cut.
- The model: A passage the retriever did not rank is indistinguishable, from inside the window, from one nobody wrote.
- How many passages to fetch: A retriever can rank the right document and still be unable to supply the sentence that answers, because that sentence is in no unit it embedded.
- Passages are not read once.: Ten chunks of 400 tokens are 4,000 tokens now and on every later call of the conversation unless the harness drops them.
- Index the fact, not the document.: The fix is in the index.
- Make the miss speak.: Set a relevance floor, mark results below it as weak, and return an explicit no-match when nothing clears it, rather than handing over the nearest passages anyway.
The fence
- The ask goes to the Retriever: your code, a tool the model calls, or the provider's search.
- The Corpus goes to the Retriever.
- The Retriever sends the passages it ranks to The window: system, tools, history, passages.
- The Retriever sends everything else Outside the window: the model cannot read it.
- The window goes to The model, which answers from the window.
Figure: What retrieval decides. Whoever runs the retriever, only the passages it ranks reach the window; everything else in the corpus stays outside, where the model cannot read it.
Tool Selection Is Not This Stage
Choosing a tool is usually not retrieval: the definitions are already in the window and nothing ranks them first, as The Tool Call Is a Round Trip shows.
The exception is a harness that makes it retrieval again. Anthropic's tool search tool defers most definitions out of the window and lets the model search the catalogue, by pattern or by keyword ranking, loading "up to 5 by default"; a search that matches nothing returns an empty list, "not an error". Once a tool must be found before it can be called, tool selection inherits every cap in this chapter.
When the Retriever Is Not the Problem
With a small corpus and a long window, put it all in; the retriever then exists to save money, and a miss is a bug you chose. For identifiers, exact strings and names, keyword search, or hybrid search that runs keywords and vectors together, tends to beat vectors alone, so a retriever that runs a word score beside the meaning score and lets either carry a result misses less. A provider-run retrieval tool hides the stage, not the cap; for most teams that is right until the first wrong answer has to be explained.
And sometimes the retriever ranked the passage and the model ignored it. That failure is the model's, which is why the two must be separable: a run showing the passage was in the window and the answer wrong points at the model, or at where the passage sat (How the Model Reads the Window); one showing it was never ranked points at the index.
What to Do Next
- Log the ranked ids with every answer. The passage list in the window at answer time is part of the audit record; the citation is a claim about it.
- Make the miss speak. Return a relevance floor and an explicit no-match to the model as text, rather than the best k regardless.
- Index the fact, not the document. Take one question your users ask and find the passage that holds its answer; then look at what the chunker, the truncation limit and the table handling left out.
- Set k per kind of ask. A person waiting and an agent re-reading its own record have different budgets and different miss costs; one k serves neither.
- Separate the causes before you blame the model. Run the same question three ways: with no passages, with the retrieved set, and with the exact passage that answers it.
Next in the series: Tokens Are the Unit of Account, on what the assembled call becomes at the provider's door. Related reading: Embeddings: How Vectors Get Meaning for the vector maths, and Search is Dead. Long Live Action. for retrieval once the goal is action.