microsoft / microsoft/agent-framework
.NET: [Feature]: Add ability to define a custom ChatHistoryProvider for Workflow as Agent
@peibekwe is already working on this.
Since Jun 4, 2026.
- Dominant language
- Python
- Stars
- 13.6k
- Forks
- 2.3k
- Avg merge
- 2d 45m
- Merged PRs (30d)
- 358
Description
### Description
When I create a Workflow as an Agent, for example:
```csharp
var agent = AgentWorkflowBuilder.BuildSequential(agent1, agent2).AsAIAgent();
var session = await agent.CreateSessionAsync();
```
The `CreateSessionAsync` method creates a [WorkflowSession](https://github.com/microsoft/agent-framework/blob/dotnet-1.9.0/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowSession.cs) that always uses a `WorkflowChatHistoryProvider`:
https://github.com/microsoft/agent-framework/blob/afa7834e2ec8a93b2224fe7ab184b97fbcaa8c9a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowSession.cs#L90
It would be useful to have the ability to specify a custom chat history provider, or change its properties, as is possible with regular Agents.
### Language/SDK
.NET
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.