Trajectory
A trajectory is the ordered sequence of states, actions, and observations recorded during a single execution run of an autonomous agent or interactive policy.
What it is
When an agent interacts with an environment, it accumulates a trace of every prompt sent, tool output received, and internal decision made. This structure typically looks like a list of state-action-reward tuples. In production LLM agents, a trajectory can easily span dozens of steps and thousands of tokens. This data is the primary artifact used to debug why an agent went off track or to train a model to behave better in future iterations.
Why it matters
Ignoring trajectories makes it impossible to perform effective root cause analysis on agent failures. If your agent is getting stuck in an infinite loop or calling the wrong tool, the trajectory is the log you inspect to find the exact step where the reasoning diverged. Failing to store these records prevents you from performing offline evaluation or using that data to improve your agent through fine-tuning.
In practice
You capture this by implementing structured logging for every turn in your agent orchestration loop. You should log the initial state, the agent's thought process, the tool call parameters, and the subsequent environment response. Tools like LangSmith or custom event emitters in your workflow help serialize this path for later analysis.
The tradeoff
The primary tradeoff is between observability and storage costs, as long, complex trajectories consume significant log storage and make debugging harder by adding noise.
Where it appears
Research summaries that use Trajectory, each linked to its source paper.
-
Learning from Failure to Improve Reasoning
ReflectRL: Learning from Golden Negative Trajectories via Reflective-to-Direct Reasoning
The researchers developed a method to train models on expert trajectories that initially contained errors, effectively turning failed reasoning attempts into useful training data.
-
Improving AI Model Training via Behavior Blending
Trust-Region Behavior Blending for On-Policy Distillation
The paper introduces a warmup method for on-policy distillation that regulates student behavior during early training to prevent the model from learning on low-quality data.
-
Improving Agent Skills Through Contrastive Distillation
SKILL-KD: Contrastive Skill Distillation for LLM Agents
SKILL-KD is a method that teaches LLM agents new procedural skills by contrasting their failed task attempts against successful demonstrations from stronger teacher models.
-
Teaching AI Agents to Use Tools
SKT: Skill-Use Training at Scale via Verified Synthetic Data Generation
The researchers developed a method called Skill-Use Training that helps artificial intelligence agents better understand and apply external tools to complete complex tasks.
-
Personalizing Autonomous Driving Using Aggressiveness Settings
STAGE: STyle-controllable Action GEneration for personalized autonomous driving
The researchers developed a method that allows autonomous cars to adjust their driving behavior based on a continuous scale of aggressiveness to better match user preferences.