Skip to main content

Data Flow

The SDK fetches raw traces from a provider, normalizes them into an intermediate format, builds a standardized Trajectory, and saves it as JSON.

Trajectory

A Trajectory is the SDK’s core output — one per conversation. It contains everything about a multi-turn agent session in a structured, typed format.
FieldTypeDescription
taskTaskConversation metadata (ID, source, turn count, tokens, cost)
stepslist[Step]Ordered sequence of decision points
rewardRewardOptional aggregate reward signal
metricsTrajectoryMetricsToken counts, tool call stats, error rates
execution_metricsExecutionMetricsTiming data (LLM time, total time)
errorstrError message if the conversation failed

Turn

A Turn is one user-to-agent exchange: a user message, zero or more tool calls, and an assistant response. Internally the SDK groups traces into turns, then builds steps from them.

Message

A Message is the atomic unit. Each has a role and optional content, tool calls, or tool responses.
RoleWhat it representsExample
systemSystem promptInstructions to the agent
userHuman input”What’s the weather?”
assistantModel output”It’s 62F and foggy.”
toolTool execution result{"temp": 62}
Assistant messages that invoke tools have a tool_calls list. Tool messages carry a tool_response with the result (or error). See the API Reference for full field definitions on all data models.