Skip to content

AgentGraphEntryAttribute

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework

AgentGraphEntryAttribute Class

Marks the decorated agent as the entry point for a named graph workflow. Exactly one agent per graph must carry this attribute.

public sealed class AgentGraphEntryAttribute : System.Attribute

Inheritance System.Object 🡒 System.Attribute 🡒 AgentGraphEntryAttribute

Example

[NeedlrAiAgent(Instructions = "Analyze the request.")]
[AgentGraphEntry("Research", RoutingMode = GraphRoutingMode.AllMatching)]
[AgentGraphEdge("Research", typeof(WebAgent), Condition = "NeedsWebData")]
[AgentGraphEdge("Research", typeof(SummaryAgent))]
public class AnalyzerAgent { }

Remarks

Graph-wide routing mode is declared here. Per-node overrides for routing mode can be specified on the first AgentGraphEdgeAttribute from a given source node.

Constructors

AgentGraphEntryAttribute(string) Constructor

Initializes a new AgentGraphEntryAttribute.

public AgentGraphEntryAttribute(string graphName);

Parameters

graphName System.String

The name of the graph this agent is the entry point for.

Properties

AgentGraphEntryAttribute.GraphName Property

Gets the graph name this agent is the entry point for.

public string GraphName { get; }

Property Value

System.String

AgentGraphEntryAttribute.RoutingMode Property

Gets or sets the graph-wide default routing mode. Individual nodes can override this via a RoutingMode property on their first AgentGraphEdgeAttribute.

public NexusLabs.Needlr.AgentFramework.GraphRoutingMode RoutingMode { get; set; }

Property Value

GraphRoutingMode