Build / How to

Retrieval trace

A retrieval trace runs a search against an agent index and shows the passages that come back, with the source of each one. Running a trace costs no credits.

What a trace is

An agent does not read your whole knowledge base to answer a question. It searches the index, takes the passages that match, and answers from those. A trace runs that same search on demand and shows you what came back.

A trace answers one question you cannot otherwise get at: when an answer was wrong, was the right material even there?

Run a trace

Ask the question the way a customer would, not the way your documents are written. is there anything cheaper for a small team is a useful query. Starter plan seat limit is not, because it already contains the vocabulary you are testing whether the agent needs.

Three controls sit above the results.

ControlWhat it sets
QuestionThe question the agent should be able to answer.
ModeContext, Links or Images. Three kinds of retrieval, which fail differently.
Top KHow many passages to ask for. Eight by default, one to twelve.

Each run reports how many results came back, how many you asked for, and how long the search took. If nothing matched, the trace says so rather than showing an empty list.

Raising Top K is a diagnostic, not a fix. If the passage you wanted appears only at eleven, ten others are outranking it, and the fix is to remove what is crowding it out.

Trace modes

ModeReturnsUse it when
ContextPassages of textThe agent answered wrongly, or said it did not know.
LinksDestinations it may send someone toIt pointed at the wrong page, or refused to link at all.
ImagesPictures it may showIt described something without showing it, or showed the wrong one.

Read the results

Results are ranked, best match first. Each result carries where it came from, which is the part that matters when something is wrong. Duvi leaves out fields with nothing in them rather than showing them empty.

FieldWhat it tells you
Source typeWhether the passage came from a crawled website or an uploaded file.
Content typeThe format it was extracted from, such as text/html or application/pdf.
Source URLThe page or file it was taken from. Open it and check the passage is still accurate.
OriginWhich of your knowledge sources it belongs to, when several are attached.
Media URLThe image itself, in Images mode.

What the results mean

Nothing came back

The material is not indexed. Check the knowledge status reads Ready rather than Pending, Indexing or Failed. A scanned PDF with no text layer is the usual cause of a silently empty index. See Indexing states. Editing the prompt will not help.

The right passage came back and the answer was wrong

This is a prompt problem. See System prompt. Usually the agent was told to be helpful in a way that outweighed being accurate.

A stale source outranked the current one

Two documents disagree and the older one matched better. Remove the stale source and reindex, or state in the prompt which source wins. The Origin field tells you which is which.

The passage is right but partial

The chunk stops mid-table, or the figure you wanted was on the row that got cut. This is a source formatting problem. A price list written as prose survives chunking better than one written as a wide table.

Limits of a trace

A trace also runs the search on demand, against the index as it stands. It is not a record of a past conversation. If you have reindexed since the answer you are investigating, the trace can legitimately differ from what the customer got.