MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent

IMentorSessionManager interface

The IMentorSessionManager interface of the global namespace: Manages the Agent Framework AgentSession for the current session. In Blazor Server: Scoped (one…

View as Markdown
On this page

Manages the Agent Framework AgentSession for the current session. In Blazor Server: Scoped (one session per circuit/user). In Blazor WASM: Singleton (one session per tab). AgentSession is the container for the Agent Framework conversation history: we do not manage messages manually — the session handles that internally.

Namespace: none, the global namespace. Package: Novior.MentorAgent.

public interface IMentorSessionManager

Terminal
dotnet add package Novior.MentorAgent

Task<AgentSession> GetOrCreateSessionAsync(AIAgent agent, CancellationToken ct = default)

Returns the current session, creating it on first access.

Task ResetAsync(AIAgent agent, CancellationToken ct = default)

Resets the current session (starts a new conversation).

Task RestoreSessionAsync(AIAgent agent, JsonElement serialized, CancellationToken ct = default)

Restores a serialized session.

Task<JsonElement?> SerializeCurrentSessionAsync(AIAgent agent)

Serializes the current session for persistence (e.g. WASM localStorage).

event Action? OnSessionChanged

Event: the session has changed (reset or restore).