Skip to content

.NET: Consolidate InMemoryAgentSessionStore in Microsoft.Agents.AI #8390

Description

Description

Track Wesley's follow-up suggestion from PR #7991: #7991 (comment).

Promote a reusable InMemoryAgentSessionStore to the Microsoft.Agents.AI package, alongside ChatClientAgent and DelegatingAgentSessionStore, and consolidate the existing implementations in Hosting and Foundry.Hosting. This is intentionally out of scope for #7991.

Both implementations store serialized sessions in concurrent dictionaries and deserialize independent session instances on lookup. Their agent identity behavior differs: Hosting uses agent.Id; Foundry.Hosting uses a resolved hosting identity, with an instance-ID fallback for unnamed agents. Define how that hosting-specific behavior is preserved without adding Foundry dependencies to the core package.

Expected outcome:

  • One reusable core implementation, with hosting packages using it or a thin adapter where identity behavior requires one.
  • Preserve partition isolation, independent restored sessions, and experimental API annotations.
  • Update registrations, public API declarations, documentation, and tests.

Code Sample

Proposed usage after promotion:

using Microsoft.Agents.AI;

AgentSessionStore store = new InMemoryAgentSessionStore();

Language/SDK

.NET

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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