pyagent-patterns — Orchestration (Tier 1)¶
pyagent_patterns.orchestration.supervisor.Supervisor
¶
Bases: Pattern
Classify → route → collect orchestration pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
classifier
|
Agent
|
Agent that classifies the task into a route key. |
required |
routes
|
dict[str, Agent]
|
Mapping of route keys to specialist agents. |
required |
formatter
|
Agent | None
|
Optional agent that formats the final response. |
None
|
default_route
|
str | None
|
Key to use when classification doesn't match any route. |
None
|
pyagent_patterns.orchestration.pipeline.Pipeline
¶
pyagent_patterns.orchestration.fan_out_fan_in.FanOutFanIn
¶
Bases: Pattern
Parallel execution with result aggregation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agents
|
list[Agent]
|
List of agents to run in parallel on the same task. |
required |
aggregator
|
Agent
|
Agent that combines all parallel outputs into one. |
required |
stream(task, context=None)
async
¶
Stream individual agent results as they complete.
pyagent_patterns.orchestration.hierarchical.Hierarchical
¶
pyagent_patterns.orchestration.orchestrator_workers.OrchestratorWorkers
¶
Bases: Pattern
Dynamic task delegation: orchestrator plans → workers execute → synthesize.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orchestrator
|
Agent
|
Agent that plans the work and synthesizes results. |
required |
workers
|
list[Agent]
|
Pool of available worker agents. The orchestrator selects from these. |
required |