Agent trajectory

ProductionEvaluationPublished By Simon Budziak

An agent trajectory is the ordered record of states, model decisions, tool calls, observations, and intermediate results produced during one AI agent run. Evaluating the trajectory shows how the agent reached an outcome, including unsafe, wasteful, or incorrect steps that a final-answer score would miss.

LangChain’s agent eval documentation treats the execution trajectory as the sequence of messages and tool calls an evaluator can inspect.

What does trajectory evaluation reveal?

It can detect a wrong tool choice, repeated retries, skipped approval, or a correct result reached through forbidden data. Outcome quality and execution quality are different measurements. AI agent evals should score both when the system can act on external state.

How is a trajectory captured?

LLM tracing records model calls, tool calls, timings, and errors as related spans. The evaluator adds task-specific expectations for the agentic workflow. Failed production trajectories should become offline evaluation cases, closing the gap between observed failures and pre-release tests.

Frequently asked questions

What information belongs in an agent trajectory?

It normally includes messages, state changes, tool names and arguments, tool results, retries, handoffs, approvals, errors, timing, and the final outcome.

Why evaluate the trajectory if the final answer is correct?

The agent may have reached the right answer through unauthorized data access, unnecessary calls, excessive cost, or a sequence that will fail on a slightly different case.

Summarize this page with

Train your team to build this