agents
Glossary ↗Agent Trajectory
A trajectory is the full recorded path an agent took through a task: every model call, every tool invocation with its arguments, every result returned, and the final answer, in order. It is the agent equivalent of a request trace, and it is the unit you evaluate, debug and replay against. The reason it matters is that a final answer alone is not enough evidence to judge an agent. Two runs can produce the same correct output while one called three tools and the other called eleven, retried a failing endpoint, and got there by luck; only one of those is a system you would put in front of customers. Conversely a wrong answer says nothing about where the failure was — bad retrieval, a mis-parsed tool result, a plan that never recovered from an early error — and without the trajectory the team is left guessing. Practical trajectory work has three parts. Capture: log the whole sequence including arguments and raw tool outputs, with the timing and token cost of each step. Evaluation: score the path as well as the destination, since step count, tool-selection accuracy and recovery behaviour are the things that predict cost and reliability in production. And replay: keep enough of the record that a stored trajectory can be re-run against a changed prompt or a new model, which is what turns a pile of past incidents into a regression suite.
Related terms