How the agent finds an answer
What happens to a document between uploading it and the agent quoting from it — and why that shapes what you should upload.
The agent does not read your documents when somebody asks a question. It could not — a model is given a fixed amount of text per turn, and your knowledge base is larger than that. What happens instead is retrieval: the question is used to find the handful of passages most likely to contain the answer, and only those are given to the model.
Everything people find surprising about agent answers comes out of that sentence. This page is the detail.
The five steps
- 1
The file is scanned
For malware, before anything touches it. A file that fails is refused and never reaches the next step.
- 2
Text is extracted
PDF, DOCX, Markdown, plain text, and spreadsheets. What comes out is text — a diagram carries nothing, and a scan of a page is a picture, not words. A file with no text in it at all is refused here, with a message saying why.
- 3
It is cut into chunks
About 300 words each, overlapping by 50. The overlap exists so a sentence that lands on a boundary is not torn in half.
- 4
Each chunk is embedded
Turned into a list of 768 numbers that stand for its meaning, so two passages saying the same thing in different words end up near each other. This is queued, never immediate — a large document is searchable shortly after upload, not instantly.
- 5
A question retrieves five chunks
The question is embedded the same way, the five nearest chunks are found, and those are what the model is given.
NoteFive chunks. About 1,500 words.
What this means for what you upload
| One subject per document | A chunk is 300 words of a document. A 40-page handbook covering everything gives chunks that each cover a little of nothing. |
|---|---|
| Write the question into the text | Retrieval matches meaning, and a heading that uses your customers' words — "How do I cancel?" — is nearer to their question than "Policy 4.2 Termination". |
| Spell out what a heading implies | A chunk arrives alone. If the price only makes sense under a heading six paragraphs up, the chunk carrying the price does not carry the heading. |
| Tables are not prose | A spreadsheet is stored as rows the agent can filter by value, and its first 500 rows are also indexed one per passage. See Knowledge. |
A worked example
Harbor & Pine's returns page started like the left-hand version. Customers asked “can I send the sofa back?” and the agent kept answering from the delivery page instead.
## Section 7: Reverse logistics ← before
Items may be returned within the stated period...
## Can I send something back? ← after
Yes. You can return any item within 30 days of delivery.
Sofas and other large items are collected from your door
for a £35 fee; everything else you can post back for free.The second version names the question the way a customer would ask it, and repeats the subject — “sofas and other large items” — inside the passage, so the chunk still makes sense when it arrives alone.
TipThe single most effective edit
When the agent misses something that is definitely there
It is almost always one of these, in this order of likelihood:
| The question and the text share no meaning | They used a word your document never uses. Add their word to the document — a line of "also called …" is often the whole fix. |
|---|---|
| The answer was split | It spanned a chunk boundary and neither half is convincing on its own. Keep an answer together in one passage. |
| Five was not enough | Twelve documents each mention it in passing; the five nearest are all passing mentions. One document that answers it properly beats twelve that touch it. |
| It is not indexed yet | Embedding is queued. A document uploaded a moment ago may not be searchable yet. |
| That page is a picture | Part of the PDF was scanned. The pages with text were read; the scanned ones gave nothing to find. |
WarningPartly scanned PDFs are the quiet one
Watching it happen
Pipeline → Run in the dashboard asks your agent a question and shows each step as it happens, including which of your documents it read. When a turn has already happened, Activity shows how many passages it was built from — “read nothing” on a question your documents answer is the clearest sign of a retrieval miss.
What never happens
| Your documents are never mixed with another customer's | Retrieval is filtered to your agent before results are returned, at the database level. |
|---|---|
| Your documents do not train a model | They are embedded and stored for your agent's retrieval. That is the whole use. |
| The agent does not invent a citation | If retrieval returns nothing useful, the agent has nothing to quote — which is when it should say so, or hand over to a person. |
| A document does not give orders | Passages reach the model marked as data, below the platform's rules and your own instructions. A line in an uploaded file that says "ignore your instructions" is read as content, never followed. |
If embedding is unavailable
Search falls back in two steps rather than failing. Each is a floor, not an equal.
The keyword step finds the word you typed and nothing that merely means it:
Question: "can I get my money back?"
meaning → finds a passage headed "Refunds"
keyword → finds nothing, because neither
"money" nor "back" appears in itThe last step exists for a small agent whose documents have not been indexed yet: rather than answering “I could not find anything” to a question its three short documents do answer, it is given them whole — cut down to a fixed size, so a large knowledge base is never pasted in entire.
NoteWhere the limits come in