Sistava

What is Agent Trajectory?

Also called agent trace, run trace.

An agent trajectory is the complete recorded sequence of a single run: every model input, decision, tool call, result, and error, in order. It is the primary artifact for debugging, evaluation, and audit, because the final answer alone does not reveal how it was produced. Trajectories also show whether an agent took a sensible route, not just whether it finished.

A useful trajectory records more than the visible messages. It captures the exact context assembled for each step, the tool arguments requested, the raw results returned, timings, token counts, and which model handled each call. Without this level of detail, a wrong final answer is nearly impossible to attribute to the step that caused it.

Trajectory-based evaluation asks different questions than answer-based evaluation. Did the agent call the right tools in a reasonable order? Did it recover after a failure or repeat it? How many steps did an outcome take? An agent can produce the correct answer through an expensive and lucky route, and only the trajectory exposes that before it fails on a similar task.

Trajectories are captured by observability tooling that instruments the loop, and they get large quickly, so systems sample, truncate long payloads, and retain full detail only for failures. They also frequently contain customer data and credentials passed as arguments, which makes redaction and access control part of the design rather than an afterthought.

Trajectories are reconstructed from agent state and the orchestrator's records, and they are how deterministic replay is achieved when a run must be examined step by step. They also feed regression testing: a stored trajectory becomes a case that a modified agent should still handle, which is one of the few practical ways to detect behavior drift after a prompt change.

Key points

In practice

An agent returns a wrong total. The answer alone gives no clue. Its trajectory shows step two queried the right table, step three requested a date range off by one day, and step four summed correctly over the wrong rows. The bug is one argument in one call, visible in seconds from the record and effectively invisible from the output.

Related terms

Back to the AI Glossary