MentorAgent
Health Pass
- License — License: Apache-2.0
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 15 GitHub stars
Code Warn
- network request — Outbound network request in Novior.MentorAgent.Abstractions/wwwroot/js/MentorAgent.js
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
Add AI agents to your .NET app: your methods become tools with role checks and human confirmation. Use the ready-made chat widget in Blazor and MAUI, or connect any frontend through SignalR, SSE, MCP or A2A.
MentorAgent
MentorAgent is an open-source .NET library that puts AI agents inside your applications, under your rules: your C#
methods become tools, and on each one you declare which roles may use it and whether the user must confirm it first.
Use the ready-made chat widget in Blazor and MAUI, or connect any front end (React, Angular, Vue, mobile) over SignalR
or SSE; AI assistants and other agents reach the same tools over MCP and A2A.
Website: mentoragent.net · Documentation: docs.mentoragent.net · Blog: mentoragent.net/blog
Built on Microsoft Agent Framework, with any provider that offers an IChatClient: Azure OpenAI, OpenAI, Ollama and others.
Which package
| You are building | Install |
|---|---|
| A Blazor Server app, or a .NET MAUI Blazor Hybrid app | Novior.MentorAgent |
| The client project of a Blazor WebAssembly or Auto app | Novior.MentorAgent.Blazor, with Novior.MentorAgent.Server on the server |
| Any other frontend (React, Angular, Vue, mobile), a Web API or a headless backend; an MCP server or an A2A agent | Novior.MentorAgent.Server |
| Specialist agents defined in YAML | Novior.MentorAgent.Declarative, next to the others |
Novior.MentorAgent.Abstractions comes with them: you never install it yourself.
Quick start
dotnet add package Novior.MentorAgent
dotnet add package Microsoft.Extensions.AI.OpenAI
// Program.cs — using Microsoft.Extensions.AI; using Novior.MentorAgent.Extensions;
builder.Services.AddScoped<OrderService>();
builder.Services.AddMentorAgent(options =>
{
options.AppName = "Orders";
options.ChatClient = new OpenAI.Chat.ChatClient("gpt-4.1-mini", builder.Configuration["OpenAI:Key"]).AsIChatClient();
options.ScanAssemblies = [typeof(Program).Assembly];
});
// OrderService.cs — using Novior.MentorAgent.Attributes;
public class OrderService
{
[MentorAction(Description = "Cancels an order", RequiresConfirmation = true, RequiredRoles = ["Manager"])]
public Task<bool> CancelOrderAsync(int orderId, string reason) { ... }
}
@* MainLayout.razor, in an interactive app — @using Novior.MentorAgent.Abstractions.Components *@
<ChatWidget />
Ask the widget to cancel an order: the assistant offers CancelOrderAsync only to a signed-in user with theManager role, and runs it only after that user confirms in the widget.
Start from a template
A clone of this repository has a dotnet new template, templates/mentoragent-blazor:
a Blazor Server helpdesk with MentorAgent inside, and a test project.
dotnet new install templates/mentoragent-blazor # from a clone of this repository
dotnet new mentoragent-blazor -n Helpdesk
cd Helpdesk
dotnet user-secrets set "Assistant:ApiKey" "<your key>" --project Helpdesk
dotnet run --project Helpdesk
The app keeps five tickets in memory and has three actions: list_open_tickets reads, assign_ticket asks for
a confirmation, and close_ticket asks for one too and needs the Agent role. A test sign-in at the top of the
page switches between Alex, an Agent, and Sam, who has no role and is never offered close_ticket; replaceTestSignIn with your application's authentication. The model comes from the Assistant section of the
configuration: Model (default gpt-4.1-mini), ApiKey in the user secrets, and Endpoint, empty for OpenAI
or the address of an OpenAI-compatible service, Azure OpenAI included. Without a key the app starts and the
page says what is missing.
dotnet test runs three tests with no key and no network: a scripted model drives the same assistant throughMentorEvaluator.RunConversationsAsync — Alex closes a ticket after confirming, the same request with the
default no leaves it open, and Sam is never offered close_ticket.
The template is not a NuGet package yet: install it from a clone.
Learn more
- Documentation: docs.mentoragent.net
- Website: mentoragent.net
- The full reference: the package README, the same as on
nuget.org - A running example: the demo, a small expense-claims app with MentorAgent inside
- Help and contributions: SUPPORT.md, CONTRIBUTING.md,
CODE_OF_CONDUCT.md - Vulnerabilities: SECURITY.md — privately, never in a public issue
- Action rules: ACTION-RULES.md — which methods become actions, and how roles
and confirmations add up - What changed: CHANGELOG.md
- What 1.3.0 promises: the API notes — which methods become actions, YAML agents
while the application runs, and the options that may change while it runs
License
Apache License 2.0: see LICENSE and NOTICE. "MentorAgent" and its logo are trademarks: see
TRADEMARKS.md for how they can be used.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found