# IMentorAgentSource interface

> The IMentorAgentSource interface of Novior.MentorAgent.Core: Supplies Level-2 specialists that were not found by the [MentorAgent] attribute scan (roadmap…

- URL: https://docs.mentoragent.net/api/novior-mentoragent-core/imentoragentsource
- Verified with: MentorAgent 1.2.0
- Last updated: 2026-10-27
- Packages: Novior.MentorAgent

Supplies Level-2 specialists that were not found by the `[MentorAgent]` attribute scan (roadmap \#23). Register an implementation before `AddMentorAgent()`; every registered source is asked once, while the coordinator is being built, and the agents it returns join the same handoff graph as the attribute-declared ones — so `route_to_specialist` can reach them and they return to the coordinator when done.

This lives in `MentorAgent` and not in `Novior.MentorAgent.Abstractions` because `AIAgent` comes from `Microsoft.Agents.AI`, which Abstractions must not reference if it is to stay WebAssembly-safe.

`Novior.MentorAgent.Declarative` is the implementation that ships: it builds agents from YAML.

## Definition

Namespace: `Novior.MentorAgent.Core`. Package: `Novior.MentorAgent`.

`public interface IMentorAgentSource`

```shell
dotnet add package Novior.MentorAgent
```

## Methods

### `GetAgentsAsync`

`Task<IReadOnlyList<AIAgent>> GetAgentsAsync(MentorAgentSourceContext context, CancellationToken ct = default)`

Builds the agents. Called once per coordinator, not per turn. Returning an empty list is normal (no definitions found) and must not throw — a source that cannot load should log and return nothing rather than take the assistant down with it.

---

- Previous: [MentorTeamAttribute class](https://docs.mentoragent.net/api/novior-mentoragent-attributes/mentorteamattribute.md)
- Next: [MentorAgentSourceContext record](https://docs.mentoragent.net/api/novior-mentoragent-core/mentoragentsourcecontext.md)
