Skip to content

.NET: Consider providing ChatHistoryProvider via the AIContextProviderFactory #3237

@westey-m

Description

@westey-m

We have merged the interfaces for ChatMessageStore and AIContextProvider since they are very similar, however we still have separate properties and factories for setting and configuring a ChatHistoryProvider vs an AIContextProvider.
We should consider whether we can combine these and pass/store both these are just AIContextProviders.

Challenges:

  1. It's valuable to be able to filter out messages that came from an AIContextProvider like RAG responses, when storing messages via the ChatHistoryProvider, since these can be transient and large. Currently we know which messages came from such AIContextProviders since they are separate from ChatHistoryProvider.
  2. Using both a ChatHistoryProvider and an AIContextProvider for memories at the same time is common, so we would need to better support combining multiple AIContextProviders out of the box. These are challenging to build, since they need to make many assumptions about how to combine AIContext and how to combine serialized state.
  3. Today, it's common for us to supply a default ChatHistoryProvider when one is required and none is provided by the user. If we switch to a combined model, it is not clear how we determine whether the supplied AIContextProviders contain a ChatHistoryProvider, since they are all just AIContextProviders.
  4. There is a requirement to be able to override the ChatHistoryProvider configured on the agent at runtime, but when combining it with other AIContextProviders, it isn't clear which one to exclude from processing.

Possible solutions:

  1. Stamp the AuthorName property of each message produced by an AIContextProvider with a name or id identifying the AIContextProvider. A ChatHistoryProvider would of course not do that since it does not produce messages, but just provides messages from some store. A filter can then be used to filter messages with specific Author Names.
  2. To be considered
  3. No known solution
  4. No known solution

Metadata

Metadata

Assignees

Labels

.NETagent memoryRelated to agentic memoryagentsIssues related to single agents

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions