What is an agent trajectory?
An agent trajectory is the complete sequence of states, decisions, actions, observations, and results that an AI agent goes through while working on a task.
It shows the path the agent followed from the beginning of execution to the final outcome.
A simplified trajectory might look like this:
Initial state → Decision → Action → Observation → Updated state → Decision → Action → Final result
Why is it called a trajectory?
The word trajectory describes the path an agent takes through a task.
Two agents can start with the same goal but follow different trajectories depending on:
- what they observe
- which actions they choose
- what tools return
- whether errors occur
- how the agent adapts
The final answer may be the same even if the path taken is different.
Example
Suppose an agent is asked:
> Find out why my order has not shipped.
A possible trajectory could be:
- Receive the order ID.
- Check payment status.
- Observe that payment succeeded.
- Check inventory.
- Observe that the product is out of stock.
- Check the expected restock date.
- Receive the restock estimate.
- Explain the shipping delay to the user.
That complete sequence is the agent's trajectory for the task.
What can a trajectory contain?
Depending on the system, a recorded trajectory may include:
- user input
- agent state
- decisions
- tool selections
- tool inputs
- tool outputs
- observations
- errors
- retries
- intermediate results
- final output
- stopping reason
The exact amount of information recorded depends on the agent framework and observability setup.
Trajectory vs. agent step
An agent step is one bounded unit of execution.
An agent trajectory is the sequence of many steps that occurred during the whole run.
For example:
Step 1: Check payment Step 2: Check inventory Step 3: Check restock date Step 4: Return answer
Together, those steps form the trajectory.
For the smaller unit, see “What is an agent step?”
Why trajectories are useful
Agent trajectories are useful for understanding how an agent behaved.
They can help developers:
- debug unexpected behavior
- see which tools were used
- understand where a failure occurred
- compare successful and unsuccessful runs
- evaluate whether the agent took unnecessary steps
- measure cost and latency
- improve prompts, policies, or tool selection
For example, if an agent repeatedly calls the same tool without making progress, that pattern becomes visible in its trajectory.
Successful and unsuccessful trajectories
A successful trajectory reaches the intended goal.
An unsuccessful trajectory may end because:
- a tool failed
- required information was unavailable
- the agent chose poor actions
- permissions prevented progress
- a maximum-step limit was reached
- a stopping condition ended execution
Studying both types can help improve the agent system.
Trajectory does not mean hidden reasoning
An agent trajectory generally refers to observable execution events, such as actions, tool calls, state changes, and results.
It does not require exposing private internal reasoning or hidden chain-of-thought.
A system can log useful execution behavior without recording or revealing hidden reasoning.
In short
An agent trajectory is the complete path an AI agent follows through a task, including its sequence of steps, actions, observations, state changes, and final outcome.
It provides a practical record of how the agent moved from the initial task to completion or failure.
Learning Sequence
AI Agents Curriculum
Explore Related Questions
Deepen your understanding across related AI Agents topics.