Concepts
Trajectory
Understanding Trajectories as records of agent interactions
Trajectory
A Trajectory
represents the detailed recording of a single run of an Agent within an Environment for a specific Task.
Overview
Trajectories capture the step-by-step history of an agent’s interaction, useful for analysis, debugging, and visualization.
They are automatically generated and associated with a Job when env.close()
is called on a linked environment.
Accessing Trajectories
The primary way to access trajectories is through a Job object using job.load_trajectories()
:
Key Properties
A Trajectory
object contains:
id
(str): Unique ID for this run.reward
(float | None): The final evaluation score from the Task’sevaluate
logic.logs
(str | None): Captured logs.error
(str | None): Error message if the run failed.trajectory
(list[TrajectoryStep
]): List of individual steps.
Each TrajectoryStep
contains:
observation_url
(str | None): URL to the step’s screenshot.observation_text
(str | None): Text observed in the step.actions
(list[dict]): Agent action(s) leading to this step’s observation.start_timestamp
/end_timestamp
(str | None): Step timing.
Visualization
- HUD Platform: The Jobs page offers the best visualization, including videos.
- Jupyter: The
trajectory.display()
method provides basic step-by-step rendering.
Related Concepts
- Job: How trajectories are grouped and accessed.
- Environment: Generates the trajectory data during a run.
- Task: Defines the scenario and evaluation logic recorded.