Agent Context
Agent context is passive identity metadata for agentic requests. It lets a harness label each LLM call with a top-level agent run and a specific reasoning/tool trajectory. Dynamo records this metadata in agent traces, but it does not change routing, scheduling, or cache behavior.
Request Schema
Each harness LLM call should include nvext.agent_context:
A single session_id can contain multiple parent and child trajectories. The
field names align with the Agent Trajectory Interchange Format so
harness trajectory files and Dynamo serving traces join without renaming; see
the collapsed section at the bottom of this page for details.
OpenAI Client Integration
When using the OpenAI Python client, pass Dynamo’s extension fields through
extra_body and set x-request-id through extra_headers:
x-request-id is the harness’s logical LLM-call ID. Dynamo copies it into
request.x_request_id; it is separate from Dynamo’s internal request ID.
Harness Integration Pattern
An existing harness does not need to import Dynamo packages or link against Dynamo runtime APIs. Framework integrations should use this shape:
- Add a small helper module that stores the current
agent_contextin a context variable. - Wrap each agent run with that context so LLM calls and tool records share the
same
session_idandtrajectory_id. - Call one helper before each OpenAI-compatible LLM request to merge
extra_body.nvext.agent_contextand setx-request-id. - Propagate context through thread pools, subprocesses, and subagent launches when those paths can make LLM calls or emit tool records.
- Include
parent_trajectory_idwhen launching a subagent from a known parent trajectory.
For trace sink setup, tool event relay, and record schema details, see Agent Tracing.
ATIF alignment
The Agent Trajectory Interchange Format (ATIF) is the JSON format
maintained as the Harbor framework data schema for complete agent
trajectories (user inputs, agent steps, tool calls, observations, subagents,
rewards). Dynamo does not emit ATIF; it emits dynamo.agent.trace.v1, a
serving-oriented trace covering request timing, tokens, cache, queue depth, and
worker placement. The two formats are complementary and join cleanly because
identifier names match:
A harness ATIF file and Dynamo’s trace stream can be joined offline on
session_id + trajectory_id without schema changes. Full ATIF reconstruction
still requires harness trajectory data; Dynamo trace records intentionally omit
prompt and response content.