AgentPrismAgentSessionStore
AgentPrism.AspNetCore.dllConnects the Microsoft Agent Framework’s Hosting.AgentSessionStore
abstraction to AgentPrism’s AgentSessionManager class.
public sealed class AgentPrismAgentSessionStore : AgentSessionStoreInheritance
Section titled “Inheritance”object ← AgentSessionStore ← AgentPrismAgentSessionStore
Inherited Members
Section titled “Inherited Members”AgentSessionStore.SaveSessionAsync(AIAgent, string, AgentSession, CancellationToken), AgentSessionStore.GetSessionAsync(AIAgent, string, CancellationToken), AgentSessionStore.DeleteSessionAsync(AIAgent, string, CancellationToken), AgentSessionStore.GetService(Type, object?), AgentSessionStore.GetService<TService>(object?), object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Does not write its own persistence code; it only delegates. This way, sessions are written to the same store, with the same identity stamp, and with the same tenant isolation, no matter which path they come through (the management API, OpenAI-compatible endpoints, or MAF hosting constructs).
This class lives in AgentPrism.AspNetCore because
Hosting.AgentSessionStore is in the prerelease Microsoft.Agents.AI.Hosting
package, and AgentPrism.Core cannot depend on that package.
In multi-tenant setups, this instance can be wrapped with MAF’s
IsolationKeyScopedAgentSessionStore class; to do so, the consumer
registers its own Hosting.AgentSessionStore before calling
MapAgentPrism.
Constructors
Section titled “Constructors”AgentPrismAgentSessionStore(AgentSessionManager)
Section titled “ AgentPrismAgentSessionStore(AgentSessionManager)”Creates a new bridge.
public AgentPrismAgentSessionStore(AgentSessionManager sessions)Parameters
Section titled “Parameters”sessions AgentSessionManager
The session manager to delegate to.
Exceptions
Section titled “Exceptions”sessions is null.
Methods
Section titled “Methods”DeleteSessionAsync(AIAgent, string, CancellationToken)
Section titled “ DeleteSessionAsync(AIAgent, string, CancellationToken)”public override ValueTask DeleteSessionAsync(AIAgent agent, string sessionStoreId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”agent AIAgent
sessionStoreId string
cancellationToken CancellationToken
Returns
Section titled “Returns”GetSessionAsync(AIAgent, string, CancellationToken)
Section titled “ GetSessionAsync(AIAgent, string, CancellationToken)”public override ValueTask<AgentSession> GetSessionAsync(AIAgent agent, string sessionStoreId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”agent AIAgent
sessionStoreId string
cancellationToken CancellationToken
Returns
Section titled “Returns”ValueTask<AgentSession>
Remarks
Section titled “Remarks”If no record exists, a new session is opened. The returned session is
stamped with sessionStoreId in both cases.
SaveSessionAsync(AIAgent, string, AgentSession, CancellationToken)
Section titled “ SaveSessionAsync(AIAgent, string, AgentSession, CancellationToken)”public override ValueTask SaveSessionAsync(AIAgent agent, string sessionStoreId, AgentSession session, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”agent AIAgent
sessionStoreId string
session AgentSession
cancellationToken CancellationToken