Class GraphOrchestrator
- Namespace
- LMKit.Agents.Orchestration.Nodes
- Assembly
- LM-Kit.NET.dll
Executes an arbitrary IOrchestrationNode graph as an IOrchestrator.
This is the SOTA composable entry point for orchestrations that can't be expressed by a single sealed orchestrator class. Pipelines, parallel fan-outs, conditional routing, and arbitrary nestings of all three become first-class citizens because every composite is just another IOrchestrationNode.
Existing orchestrators (PipelineOrchestrator, ParallelOrchestrator, RouterOrchestrator, SupervisorOrchestrator) remain available for callers who prefer the named, prebuilt patterns. This type is purely additive.
public sealed class GraphOrchestrator : OrchestratorBase, IOrchestrator
- Inheritance
-
GraphOrchestrator
- Implements
- Inherited Members
- Extension Methods
Examples
var graph = new SequentialNode("flow",
new AgentNode("classify", classifier),
new ConditionalNode("route",
async (ctx, ct) => await classifier.RunAsync(ctx.Input, ct).ContinueWith(t => t.Result.Content.Trim()),
new Dictionary<string, IOrchestrationNode>
{
["technical"] = new AgentNode("tech", techExpert),
["business"] = new AgentNode("biz", bizExpert)
},
defaultBranch: new AgentNode("generalist", generalist)),
new ParallelNode("review",
new[] { new AgentNode("style", styleReviewer), new AgentNode("facts", factChecker) }));
var orchestrator = new GraphOrchestrator(graph);
var result = await orchestrator.ExecuteAsync("question");
Constructors
- GraphOrchestrator(IOrchestrationNode, string)
Initializes a new GraphOrchestrator rooted at the supplied node.
Properties
- Name
Gets the name of this orchestrator.
- Root
Gets the root node of the graph executed by this orchestrator.
Methods
- ExecuteCoreAsync(OrchestrationContext, OrchestrationOptions, CancellationToken)
Core orchestration logic implemented by derived classes.