What is an AI agent trajectory?

An agent trajectory is the ordered record of thought, action, tool call and observation steps an AI agent produces while carrying out a task, showing how it solved the task or where it went astray.

Unlike looking only at the final answer, it makes the process visible: even with a correct answer the agent may have called an unnecessary or unauthorised tool. Agent evaluation scores trajectories on outcome and process, while LLM observability tracks them in production.

Topic
Agents and protocols
Also known as
Agent trace

How an AI agent trajectory works

  1. Each step records the model input, thought or plan, chosen tool, parameters and returned observation.
  2. Steps join under one trace with timing and identifiers.
  3. Evaluation compares the trajectory with expected steps, rules or the end state.
  4. Faulty trajectories are reviewed and fixed through instruction, tool definition or permission changes.

In more detail

Process versus outcome metrics and flexible trajectory evaluation

Trajectory evaluation relies on two complementary classes of metrics: outcome metrics (final state correctness, `pass^k` consistency) and process metrics (step efficiency, tool-call precision/recall, policy-violation rate and redundant-loop detection). Relying on exact trajectory matching is often brittle because multiple valid tool paths can reach the same correct state.

Standardising trajectories with OpenTelemetry GenAI semantic conventions

In enterprise stacks, agent trajectories are standardised using OpenTelemetry Generative AI Semantic Conventions (`gen_ai` attributes), modelling each agent run, LLM call and tool execution as nested spans. Standardising trace schemas lets teams correlate agent decisions with downstream database latency, token cost and security alerts in one platform.

Using trajectories for regression tests and fine-tuning

Beyond debugging, verified trajectories serve as valuable assets for regression testing and fine-tuning. Failing trajectories become golden failure cases in CI/CD evaluation suites, while successful, policy-compliant trajectories can be curated, after PII scrubbing, into supervised fine-tuning or preference datasets.

Auditable trajectories when reasoning traces are hidden or summarised

With current reasoning models that hide raw chain-of-thought or emit only summarised reasoning traces, teams often cannot inspect verbatim internal thoughts in trajectories. Auditing therefore relies primarily on observable tool calls, structured plans, parameter diffs and final state transitions rather than unverified reasoning text.

Commonly confused terms

TermHow it differs
Observability traceAgent trajectory is the complete, ordered sequence of thoughts, actions, tool calls and observations for a single agent run; an observability trace (e.g., OpenTelemetry) is the broader telemetry container that may also include infrastructure spans, latencies, token counts and sub-agent or upstream service calls.
Agent stateAgent trajectory is the immutable chronological log of every step taken during execution; agent state is the live, mutable snapshot of active variables, plan progress and pending approvals used to decide the next step.
pass@k versus pass^k`pass@k` measures whether at least one out of `k` independent attempts succeeds (optimistic upper bound); `pass^k` (introduced in τ-bench) measures whether all `k` independent attempts succeed, capturing production reliability and consistency.

Why an AI agent trajectory matters for on-premises AI

The paper introducing interleaved reasoning and acting shows reasoning traces help a model build, track and update action plans while improving interpretability. A benchmark of tool, agent and user interaction compares the database state at the end of a conversation with the goal state and proposes a metric for consistency over repeated trials; even strong 2024 agents succeeded on under half the tasks, with success across all eight trials under 25% in retail. In-house, trajectory logs are core evidence for audit and debugging.

ON-PREMISES EXAMPLE

A public hospital reviewing its appointment agent's trajectories finds a flow where the agent called the cancellation tool without user consent, then adds a consent step to the tool.

Common questions

Why record agent trajectories?

To see which tools the agent called with which parameters, even when the answer is right. Audit, debugging and evaluation rely on this record.

Can trajectories hold sensitive data?

Yes; tool parameters and observations may contain personal or confidential information. Protect logs with access control, masking and retention rules.

Sources

In the glossary: Glossary, A to D

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.