supervisor

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 5

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

func New(ctx context.Context, conf *Config) (adk.ResumableAgent, error)

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.

Types

type Config

type Config struct {
	// Supervisor specifies the agent that will act as the supervisor, coordinating and managing the sub-agents.
	Supervisor adk.Agent

	// SubAgents specifies the list of agents that will be supervised and coordinated by the supervisor agent.
	SubAgents []adk.Agent
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL