Documentation
¶
Overview ¶
Package supervisor implements the supervisor pattern for multi-agent systems, where a central agent coordinates a set of sub-agents.
Unified Tracing ¶
The supervisor pattern provides unified tracing support through an internal container. When using callbacks (e.g., for tracing or observability), the entire supervisor structure (supervisor agent + all sub-agents) shares a single trace root. This means:
- OnStart is invoked once at the supervisor container level
- The callback-enriched context (containing parent span info) is propagated to all agents
- All agents within the supervisor appear as children of the same trace root
This is achieved by wrapping the supervisor structure in an internal container that acts as the single entry point for tracing. The container delegates all execution to the underlying agents while providing a unified identity for callbacks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a supervisor-based multi-agent system with the given configuration.
In the supervisor pattern, a designated supervisor agent coordinates multiple sub-agents. The supervisor can delegate tasks to sub-agents and receive their responses, while sub-agents can only communicate with the supervisor (not with each other directly). This hierarchical structure enables complex problem-solving through coordinated agent interactions.
The returned agent is wrapped in an internal container that provides unified tracing. When used with Runner and callbacks, all agents within the supervisor structure will share the same trace root, making it easy to observe the entire multi-agent execution as a single logical unit.