Skip to content

Conversation

@westey-m
Copy link
Contributor

Motivation and Context

Today there isn't good support for scenarios where chat history is stored in a custom store and a developer wants to bootstrap new threads with the existing data. There also isn't good support for cases where a host application may want to override any chat history storage that an agent uses, to better support the protocol that the agent is exposed via.

#2325

Description

  • Adding the ability to supply a ChatMessageStore when creating a new thread via ChatClientAgent.
  • Adding the ability to supply override features to GetNewThread, DeserializeThread and RunAsync/RunStreamingAsync that allow per-thread or per-run chat message store overrides.
  • Creating the ChatMessageStore on ChatClientAgentThreads when the ChatClientAgentThreads is created to allow retrieving and modifying it before the first run.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

…stom ChatMessageStore support (#2345)

* Add the ability to override services on an agent per run.

* Remove Run from AgentFeatureCollection name.

* Adding features param to GetNewThread.

* Move feature collection.

* Add features to DeserializeThread

* Remove servicecollection based option

* Add feature collection unit tests and fix bug identified in code review.

* Add more unit tests for DelegatingAIAgent and AgentRunOptions

* Fix formatting.

* Address PR comments.

* Switch to dedicated ConversationIdAgentFeature and improve 3rd party storage samples.

* Fix bug in sample.
@markwallace-microsoft markwallace-microsoft added .NET workflows Related to Workflows in agent-framework labels Nov 20, 2025
* Update AgentFeatureCollections with feedback

* Address feedback.

* Fix issue with sample.

* Change generic type restriction to notnull

* Remove revision

* Update dotnet/src/Microsoft.Agents.AI.Abstractions/Features/AgentFeatureCollectionExtensions.cs

Co-authored-by: Copilot <[email protected]>

* Add revision back again and improve some formatting.

* Remove virtual from revision.

* Add overloads taking type as param and add unit tests.

---------

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET workflows Related to Workflows in agent-framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants