MentorAgent Docs
Menu

Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.

ReferencePackage: Novior.MentorAgent

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.

Example
[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) { }
}

Namespace: Novior.MentorAgent.Attributes. Package: Novior.MentorAgent.

public sealed class MentorAgentAttribute : Attribute

Terminal
dotnet add package Novior.MentorAgent

public MentorAgentAttribute()

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.

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"]

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.