# Agent traces

An agent trace is the recorded history of one agent run: every model call, tool call, and retrieval step, in order, with what went in and what came out. It's the record you read to find out what an agent did, since the final answer only shows where it ended up.

A trace is made of spans. A span is one unit of work, such as a single LLM call or a single tool call, with its timing, inputs, outputs, and metadata. Spans share a trace ID, and each child span points to its parent, so a trace is a tree. An agent that calls a tool, reads the result, and calls the model again produces nested spans in the order they happened. A session sits one level above: it groups the traces from one conversation, where each trace covers one user turn.

Agents need traces because an agent chooses its own path, so the same input can take different routes on different runs. Logs and metrics can tell you a run was slow or threw an error. The trace is what shows which step went wrong and what the agent had in front of it when it decided.

The word is also used for something else. A reasoning trace is the model's written thinking inside one call. An agent trace records the calls themselves, and may or may not carry that text.

A trace is only as complete as the instrumentation that produced it. A step the code never emitted is missing from the record, and so is any content redacted before it was stored.

## Questions answered under this concept

- [How do I read a trace to find why a run failed?](https://tessary.ai/answers/agent-traces/how-do-i-read-a-trace-to-find-why-a-run-failed)

---

Source: https://tessary.ai/answers/agent-traces
All concepts: https://tessary.ai/answers
From Tessary, agent reliability for AI agents in production: https://tessary.ai
