microsoft / microsoft/agent-framework

.NET: Consolidate InMemoryAgentSessionStore in Microsoft.Agents.AI

Open
#8,390 0 comments 0 reactions 0 assignees View on GitHub
.NET
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

### Description

Track Wesley's follow-up suggestion from PR #7991: https://github.com/microsoft/agent-framework/pull/7991#discussion_r4007878901.

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:

```csharp
using Microsoft.Agents.AI;

AgentSessionStore store = new InMemoryAgentSessionStore();
```

### Language/SDK

.NET

Contributor guide

Open the contributing guide

Research direction

Start by comparing the existing InMemoryAgentSessionStore implementations in Hosting and Foundry.Hosting, along with their registrations, public API declarations, documentation, and tests. Define how hosting-specific agent identity can remain available without Foundry dependencies in Microsoft.Agents.AI. Done means one reusable core implementation or a thin adapter, with partition isolation, independent restored sessions, and experimental API annotations preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend-api-design
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.