Skip to content

.NET: [Feature]: Share AgentSessionStore through Abstractions #7990

Description

Description

Microsoft.Agents.AI.Hosting and Microsoft.Agents.AI.Foundry.Hosting expose different AgentSessionStore abstractions. Storage implementations therefore depend on a specific hosting package and cannot be reused consistently across hosting protocols.

Promote the Foundry Hosting contract to Microsoft.Agents.AI.Abstractions as the shared experimental Microsoft.Agents.AI.AgentSessionStore type. The shared contract should return null for missing sessions, provide an explicit get or create operation, and require callers to provide the nullable user partition explicitly. Hosting packages and storage implementations should consume this single abstraction.

This differs from #6082 and PR #6191. Those track a documentation correction for the previous Hosting contract. This proposal replaces that contract and aligns its behavior with Foundry Hosting.

Code Sample

AgentSession session = await store.GetOrCreateSessionAsync(
    agent,
    conversationId,
    userId,
    cancellationToken);

await store.SaveSessionAsync(
    agent,
    conversationId,
    session,
    userId,
    cancellationToken);

Language/SDK

.NET

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETUsage: [Issues, PRs], Target: .Net

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions