Agent Trajectory
What is an agent trajectory?
An agent trajectory is the ordered sequence of states, decisions, actions, and observations produced while an AI agent works through a task. It represents the path taken from the initial goal to success, failure, escalation, or another terminal state.
Two agents can reach the same final answer through very different trajectories.
What a trajectory contains
A trajectory may include:
- the goal and initial context;
- plans or task decompositions;
- model decisions;
- selected tools and arguments;
- tool results and environmental observations;
- state updates;
- retries, reflections, and handoffs;
- the final output and completion status.
For example, one research agent may retrieve the correct source immediately, while another performs several irrelevant searches before reaching the same answer.
Agent trajectory versus trace
A trajectory is the conceptual path of agent behavior. A trace is the structured telemetry record that captures execution events and timing.
The trace is one way to observe a trajectory. It may also contain infrastructure details—such as network spans, cache events, or service timing—that are not part of the agent's decision path.
Why evaluate trajectories?
Final-output evaluation can miss important failures. An agent may produce a correct answer after accessing unauthorized data, repeating expensive calls, or ignoring a required approval step.
Trajectory evaluation examines whether the path was safe, efficient, grounded, and consistent with instructions. It can identify unnecessary tools, loops, poor recovery, and reasoning-to-action mismatches.
Challenges
There may be several valid paths to the same goal, so evaluation should not require one exact sequence unless the process is regulated or safety-critical. Long trajectories are also difficult to compare, and stored records may contain sensitive information.
Builders should define which events are essential, redact secrets, and preserve enough provenance to connect actions with outcomes.
Why it matters
Agentic systems act over time. Understanding only the final message is insufficient when intermediate actions affect external systems.
Trajectories make decision quality and operational efficiency visible. They support debugging, evaluation, reflection, and process improvement while helping teams distinguish a lucky success from a reliable execution pattern.