docs / schema / steps

Steps

The steps array contains the conversation as a sequence of LLM API calls. Each step follows the TAO (Thought-Action-Observation) pattern from ATIF.

Step Structure

{
  "step_index": 2,
  "role": "agent",
  "content": "I'll investigate the failing test...",
  "reasoning_content": "The user wants me to...",
  "model": "anthropic/claude-sonnet-4-20250514",
  "system_prompt_hash": "sp_a1b2c3",
  "agent_role": "main",
  "parent_step": null,
  "call_type": "main",
  "tools_available": ["bash", "read", "edit", "glob", "grep", "write", "agent"],
  "tool_calls": [],
  "observations": [],
  "snippets": [],
  "token_usage": {},
  "timestamp": "ISO8601"
}

Fields

FieldTypeRequiredDescription
step_indexintegeryesSequential step number
rolestringyes"system", "user", or "agent"
contentstringnoMessage content; may be empty for pure tool or warmup steps
reasoning_contentstringnoThinking content
modelstringnoModel used (provider/model-name)
system_prompt_hashstringnoReference to system_prompts lookup table
agent_rolestringno"main", "explore", "plan", etc.
parent_stepintegernoStep index of parent (for sub-agents)
call_typestringno"main", "subagent", or "warmup"
tools_availablestring[]noTools available at this step
tool_callsToolCall[]noTool invocations made in the step
observationsObservation[]noTool results linked back by source_call_id
snippetsSnippet[]noExtracted code blocks
token_usageTokenUsagenoPer-step token usage breakdown
timestampstringnoISO8601 timestamp

call_type Values

ValueDescription
mainPrimary agent step
subagentSub-agent invocation
warmupCache priming call with no useful output

Tool Calls

{
  "tool_calls": [
    {
      "tool_call_id": "tc_001",
      "tool_name": "bash",
      "input": {
        "command": "npm test -- --grep parser"
      },
      "duration_ms": 3400
    }
  ]
}

Tool calls carry a tool_call_id. Observations link back via source_call_id.

Observations

{
  "observations": [
    {
      "source_call_id": "tc_001",
      "content": "FAIL src/parser.test.ts...",
      "output_summary": "1 test failed: parser.test.ts line 42 assertion error",
      "error": null
    }
  ]
}

output_summary is a lightweight preview so consumers can assess relevance without downloading full multi-KB outputs.

Snippets

Code blocks extracted from tool results and agent responses:

{
  "snippets": [
    {
      "file_path": "src/parser.ts",
      "start_line": 42,
      "end_line": 55,
      "language": "typescript",
      "text": "function parseToken(input: string)..."
    }
  ]
}

Token Usage

Per-step token breakdown:

{
  "token_usage": {
    "input_tokens": 12400,
    "output_tokens": 890,
    "cache_read_tokens": 11200,
    "cache_write_tokens": 1200,
    "prefix_reuse_tokens": 11200
  }
}

Sub-Agent Hierarchy

Sub-agent steps use parent_step to link back to the invoking step:

{
  "step_index": 5,
  "role": "agent",
  "agent_role": "explore",
  "parent_step": 3,
  "call_type": "subagent",
  "content": "Searching for related parser implementations..."
}

Sub-agent transcripts are linked by session_id reference to separate trajectory records, not embedded.