Table of Contents

Class AgentNode

Namespace
LMKit.Agents.Orchestration.Nodes
Assembly
LM-Kit.NET.dll

Leaf node that delegates execution to a single Agent.

Per-agent AgentExecutionOptions are derived from the active OrchestrationOptions via the same single source-of-truth helper (CreateAgentOptions(OrchestrationOptions)) that every other orchestrator uses, so timeouts, sampling, completion-token caps, and reasoning level flow through identically whether the agent is invoked from a graph node or a classic PipelineOrchestrator stage.

When invoked under a GraphOrchestrator (the typical case), the per-agent run is routed through the orchestrator host so BeforeAgentExecution, AfterAgentExecution, distributed-trace spans, and streaming all behave identically to a PipelineOrchestrator stage. When invoked directly without a host, the node falls back to a plain RunAsync(string, AgentExecutionOptions, CancellationToken) call.

public sealed class AgentNode : IOrchestrationNode
Inheritance
AgentNode
Implements
Inherited Members

Constructors

AgentNode(string, Agent)

Initializes a new AgentNode.

Properties

Agent

Gets the underlying agent.

Name

Stable name for tracing / observability. Two nodes in the same graph should not share a name.

Methods

InvokeAsync(NodeContext, CancellationToken)

Executes this node with the supplied context and returns its result. Implementations must:

  • Honor cancellationToken — surface cancellation rather than spinning silently.
  • Record results into Orchestration via AddResult / AddTrace for observability.
  • Avoid mutating the input context's scalar properties beyond what is documented.
Share