Agent trajectories

Updated at:

Agent Trajectories converts integrated traces into structured execution records that comply with the ATIF standard. This helps you browse the inputs, outputs, model calls, tool calls, and complete execution steps of an agent, and add valuable trajectories to datasets for subsequent evaluation, training, and iterative optimization. This topic describes how to enable trajectory processing, filter trajectories, view trajectory details, and add trajectories to a dataset.

What is an agent trajectory

An agent trajectory is structured JSON data that is generated from trace data based on the ATIF standard. ATIF stands for Agent Trajectory Interchange Format. In the ATIF specification, a trajectory is defined as a series of interactions between a user and an agent, and covers the internal reasoning, actions, and environment observations of the agent. A trajectory records the complete interaction history, including all user messages (both the initial message and subsequent messages), agent responses, tool executions, and environment feedback.

Therefore, agent trajectories provide the following benefits:

  • AI-native readability: The standardized JSON schema models the agent loop directly. AI can parse the complete decision chain without stitching spans together.

  • No stitching required for evaluation: Step-level inputs and outputs are recorded together with trajectory-level aggregated metrics, which makes evaluation and analysis ready to use out of the box.

  • Redundant information removed: An agent trajectory retains only the agent behavior information from OpenTelemetry traces and removes agent infrastructure data, such as hosts, operating systems, processes, containers, Kubernetes, and deployment environments. This reduces the impact of redundant information on evaluation and lowers token consumption.

Relationship between sessions, traces, and agent trajectories

A session, a trace, and an agent trajectory are expanded level by level, and the relationship between them is 1:N:N.

  • Session: A complete interaction process between a user and an agent application. A session contains multiple rounds of dialogue.

  • Trace: One round of interaction in a session, which is the complete link from a single user input to the final output of the system. A trace records all call details of this round of input and output, including all call details and durations of the primary agent and sub-agents. A trace is the basic unit of tracing.

  • Agent trajectory: The complete execution process of a single agent instance when it processes the round of requests. An agent trajectory includes details such as model calls, the reasoning process, tool calls, input and output content, and token consumption.

Description of the hierarchy

The three concepts are expanded level by level in a containment relationship. The cardinality is described as follows:

  • Session → Trace: 1:N
    A complete session contains multiple rounds of interaction, and therefore corresponds to multiple traces.

  • Trace → Agent trajectory: 1:1
    After a trace (one round of interaction) is processed, one complete agent trajectory JSON record is generated.

Note: If the round of interaction involves calls between a primary agent and sub-agents, the execution details of the sub-agents are included in this single agent trajectory JSON record as a nested structure, and are not split into multiple independent trajectory records.

Enable or disable agent trajectory processing

Enable during space creation

When you create an AgentSpace, Agent Trajectories is selected by default. Keep the selection and create the space to enable trajectory processing for that space. If you do not need this feature, clear the check box before creating the space.

Enable for an existing AgentSpace

  1. Log on to the AgentLoop console. Select the target AgentSpace.

  2. In the left-side navigation pane, choose Data Center > Agent Trajectories.

  3. Perform the operation based on the page status:

    • If trajectory storage has not been initialized, click Enable Trajectory Processing, and then click Confirm in the confirmation dialog box.

    • If trajectory processing is disabled, click Enable Trajectory Processing, and then confirm.

    • If the page indicates that observable data has not been integrated, click Go to Integration, complete the data integration, and then return to this page.

Note: Enabling trajectory processing may incur trajectory processing fees.

Disable or enable trajectory processing

In the upper-right corner of the Agent Trajectories page, click Disable Trajectory Processing or Enable Trajectory Processing, and then confirm in the dialog box.

After you disable the feature, the system immediately stops converting new traces into agent trajectories. Existing historical trajectories are retained. When you re-enable the feature, the system starts processing traces from the new point in time and does not retroactively process traces generated during the disabled period.

Browse and filter trajectories

  1. In the target AgentSpace, choose Data Center > Agent Trajectories.

  2. In the upper-right corner of the page, set the time range.

  3. Click the search bar or Quick Filters to set one or more filter criteria.

    Filter

    Description

    Agent Application

    Select one or more agent applications.

    Model

    Select a model that was called during the execution.

    Tool Calls

    Select a tool that was called during the execution.

    Steps

    Filter by step count: greater than, less than, equal to, or in a range.

    Duration

    Filter by duration: greater than, less than, equal to, or in a range. Supports seconds and minutes.

    TraceID

    Enter a TraceID for exact matching.

    SessionID

    Enter a SessionID for exact matching.

    Input/Output

    Select Semantic Search or Keyword Matching to search the input or output content of trajectories.

  4. Click Search. Active filter criteria are displayed in the search bar. You can remove them individually. To clear all criteria, click Reset or Clear All.

  5. View the results in the list. The following table describes the columns.

    Column

    Description

    Input/Output

    The primary input and final output of the agent execution.

    Agent

    The agent application or agent name.

    Tokens

    The total number of tokens consumed by the trajectory.

    Duration

    The total time taken from start to finish of the trajectory.

    Steps

    The number of steps in the trajectory.

    Model Calls

    The models called and the number of calls to each model.

    Tool Calls

    The tools called and the number of calls to each tool.

    Start Time

    The start time of the trajectory.

    Trajectory

    A preview of the ATIF trajectory content.

    You can click a model or tool name to quickly add it as a filter criterion. Click any trajectory row to go to the trajectory details page.

View trajectory details

The trajectory details page presents an agent trajectory from three perspectives: overall metrics, execution steps, and basic information.

Overall metrics

The top of the page displays the following metric cards:

  • Steps: The total number of steps, and the number of steps for the system, user, and agent roles.

  • Tool Calls: The total number of tool calls, and the number of successful and failed calls.

  • Tokens: The total number of tokens, and the number of input and output tokens.

  • Duration: The total duration and the start and end time of the execution.

  • Model: The primary model used in the trajectory.

Execution steps

In the Execution Steps area, you can:

  • Search for steps by keyword.

  • View the role, time, content, model calls, tool calls, tokens, and duration of each step.

  • Click a step to expand the full content. When the trajectory contains relevant data, you can also view the reasoning process, tool call input parameters and results, and associated sub-agent trajectories.

  • Use Expand All or Collapse All to control all step details at once.

Input/Output and basic information

The right side of the page provides the following information:

  • Input/Output: Switch between tabs to view the complete input and output of the execution.

  • Basic Information: View and copy the session ID and trajectory ID, and view the ATIF version.

  • Agent Information: View the agent name, version, model, and tool definitions.

View trajectory JSON

Click View Trajectory JSON in the upper-right corner of the page to view the complete ATIF JSON. You can search, collapse, or copy content in the JSON panel.

Add trajectories to a dataset

You can add trajectories to a dataset in batches from the trajectory list, or add a single trajectory from the details page.

Add from the trajectory list

  1. In the trajectory list, select the check boxes of one or more trajectories. To process all results within the current filter range, click Select All.

  2. Click Add to Dataset at the bottom of the page.

  3. Select whether to create a new dataset or write to an existing dataset, and select or map the fields as prompted.

  4. Confirm the write operation.

When the data volume is large, the system creates a background import task. You can check the progress in the task list as prompted.

Add from the trajectory details page

  1. In the upper-right corner of the trajectory details page, click Add to Dataset.

  2. Select the target dataset and the fields to write, and then confirm.

FAQ

Will historical trajectories be deleted after I disable trajectory processing?

No. Disabling trajectory processing only stops the system from generating new agent trajectories. All existing historical trajectories are retained. When you re-enable the feature, the system starts processing traces from the new point in time and does not retroactively process traces generated during the disabled period.