MentorAgentAttribute class
The MentorAgentAttribute class of Novior.MentorAgent.Attributes: Level 2 — Decorates a class to turn it into a specialized AI agent with a Handoff Workflow…
On this page
Level 2 — Decorates a class to turn it into a specialized AI agent with a Handoff Workflow. The class must be registered in the DI container; implementing IMentorAgent is optional (discovery is by this attribute alone). MentorAgent builds a ChatClientAgent whose tools are the class's methods marked [Description] or [MentorAction], and connects it to the Handoff graph via HandoffTo.
[MentorAgent(
Name = "OrderAgent",
Description = "Handles everything related to orders: creation, tracking, cancellation",
HandoffTo = ["CustomerAgent", "InvoiceAgent"]
)]
public class OrderAgent : IMentorAgent
{
[Description("Creates a new order")]
public async Task<Order> CreateOrder(int customerId, List<string> products) { }
}Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Attributes. Package: Novior.MentorAgent.
public sealed class MentorAgentAttribute : Attribute
dotnet add package Novior.MentorAgentConstructors
Section titled “Constructors”public MentorAgentAttribute()
Properties
Section titled “Properties”Description
Section titled “Description”public required string Description { get; init; }
Description of the agent's capabilities. Used by the Main Coordinator to decide when to hand off to this agent.
HandoffTo
Section titled “HandoffTo”public string[] HandoffTo { get; init; }
Names of other [MentorAgent] agents this agent can hand off to. Must match the Name values of other MentorAgentAttribute instances. Example: HandoffTo = ["CustomerAgent", "InvoiceAgent"]
Instructions
Section titled “Instructions”public string? Instructions { get; init; }
Instructions (system prompt) for this agent. If null, MentorAgent auto-generates a prompt from Name and Description.
public required string Name { get; init; }
The agent name. Used as name in the ChatClientAgent and as the key in the Handoff graph.
