Class SupervisorOrchestrator
- Namespace
- LMKit.Agents.Orchestration
- Assembly
- LM-Kit.NET.dll
Orchestrator where a supervisor agent dynamically coordinates worker agents.
The supervisor agent decides which worker agents to invoke and how to combine their outputs to accomplish the task. This enables flexible, adaptive workflows.
public sealed class SupervisorOrchestrator : OrchestratorBase, IOrchestrator
- Inheritance
-
SupervisorOrchestrator
- Implements
- Inherited Members
Examples
var supervisor = new SupervisorOrchestrator(coordinatorAgent)
.AddWorker(researchAgent)
.AddWorker(codeAgent)
.AddWorker(reviewAgent);
var result = await supervisor.ExecuteAsync("Build a REST API for user management");
Remarks
How It Works
- The supervisor receives the task and the list of available workers.
- The supervisor decides which worker(s) to delegate to via the delegate tool.
- Worker results are returned to the supervisor.
- The supervisor continues until it produces a final answer.
Use Cases
- Complex tasks requiring dynamic agent selection
- Tasks where the execution path isn't known in advance
- Collaborative problem-solving with specialized agents
Constructors
- SupervisorOrchestrator(Agent)
Initializes a new instance of the SupervisorOrchestrator class.
Fields
- DefaultSupervisorPrompt
The default supervisor prompt template.
Properties
- Name
Gets the name of this orchestrator.
- Supervisor
Gets the supervisor agent.
- SupervisorPromptTemplate
Gets or sets the system prompt template for the supervisor.
Use {workers} as a placeholder for the worker descriptions. Set to
nullto use the supervisor's existing prompt.
- Workers
Gets the registered worker agents.
Methods
- AddWorker(Agent)
Adds a worker agent.
- AddWorker(string, Agent)
Adds a named worker agent.
- ExecuteCoreAsync(OrchestrationContext, OrchestrationOptions, CancellationToken)
Executes the supervisor orchestration.