Agent trace
An agent trace is the sequence of model calls, tool calls, arguments, and results from an agent.
An agent trace is the recorded history of one agent run. It lists each call to the language model, each tool call the model requested, the arguments of those calls and the results they returned. Entries appear in the order they happened. A trace often also records timing, token counts and errors for each step.
The trace exists because the steps of an agent are chosen at run time and are not written down in advance. Without a record, it is hard to know why an agent reached a given result. The trace shows which tools the agent used and what it saw before each decision. Developers read traces to find the step where a run went wrong.
Traces are a form of telemetry for agents, similar to distributed traces for services. Teams use them for debugging, for evaluation and for audits of what an agent did. In reinforcement learning, a trace of a rollout can serve as training data after it is scored. When an agent runs code in a sandbox, the trace links each command to its output in that sandbox.
Related terms