Subgraph Trace Collection Feature
Optimizer-internal feature that captures both per-subgraph traces and whole-agent trajectory.
Installed by optimizers on temporary agents during training to collect demonstrations from successful runs. Not intended for direct end-user use.
Driven entirely by pipeline events — no special hooks inside subgraphs are required:
Per-subgraph traces: at subgraph start, the prompt messages are snapshotted; every LLM call updates the running snapshot for the innermost active subgraph; on subgraph completion the snapshot is diffed against the start state and cleaned into Demonstration.
Whole-agent trajectory: the prompt+responses from the last LLM call in the run. Useful for trajectory-based optimizers (ACE, ReasoningBank).
Properties
Storage key under which the CollectedSubgraphTraces container is published.
Functions
Creates the default SubgraphTraceCollectionConfig.
Registers the pipeline interceptors that capture per-subgraph traces and the whole-agent trajectory.