Skip to main content

AgentTrace

The top-level container for a complete agent execution.

Methods

Serialisation


TraceNode

One span in the execution trace.

Span kinds

Custom kind strings are allowed — downstream tools render them generically.

Well-known metadata keys

Factory: TraceNode.mcp_tool()

Convenience constructor for MCP tool spans — pins the metadata conventions so Origin and dashboards render them consistently:

DAG wiring examples

Linear pipeline — no parent_id needed:
Plan-act with parallel tool calls:
Both p1 and p2 carry prompt_id="planner" and optimize=True. Reflex will optimize the single planner prompt and the update applies to every step.