Trajectory Recording
Record agent execution trajectories for learning.
Ingesting Trajectories
zubbl.ingest(
trajectory_id="traj-001",
task_description="Analyze codebase for security issues",
steps=[
{"action": "read_file", "tool_name": "file_reader", "tool_output": "..."},
{"action": "analyze", "tool_name": "ast_parser", "tool_output": "..."},
],
status="success", # "success" | "failure" | "partial"
metadata={"tokens": 1240, "duration_ms": 3200},
)
IngestRequest Fields
| Field |
Type |
Required |
Description |
trajectory_id |
string |
Yes |
Unique ID for the trajectory |
tenant_id |
string |
Auto |
Extracted from API key |
task_description |
string |
Yes |
What the agent was doing |
steps |
list[Step] |
Yes |
Ordered list of actions taken |
status |
string |
Yes |
Outcome: success, failure, partial |
metadata |
dict |
No |
Extra data (tokens, duration, etc.) |
Step Schema
| Field |
Type |
Description |
action |
string |
What the agent did |
tool_name |
string |
Tool used (if any) |
tool_input |
string |
Input to the tool |
tool_output |
string |
Output from the tool |
reasoning |
string |
Agent's reasoning (if captured) |