microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
21.77k stars 3.24k forks source link

.Net - Agents: Consolidated User History in Group Chat #7316

Closed lavinir closed 2 months ago

lavinir commented 3 months ago

History management is required in order to keep maintaining chat conversations as eventually potentially irrelevant context is still sent, but more importantly context size will run out. There needs to be an option to make the history mutable while still maintaining a single source of truth that is synced between the owning group chat and the participating agents. It would make the most sense, for the source of truth to be the chat owner - which is the group chat object. Specifically, this would fit for handling the required functionality needed to reduce / truncate the existing history at that level and then having that history propagate down to the agents.

matthewbolanos commented 3 months ago

Today, we have a group chat which is connected to an agent via a "channel". In the Assisatnts API implementation, the channel connects to a "thread" object in the Assistants API service. OpenAI is then able to use that "thread" to do truncation and other summarization logic.

If the "channel" for chat completion agents did something similar (e.g., a local thread), the developer could theoretically use that to do their own truncation and summarization that is separate from the "source of truth" in the group chat. Would that work for your needs?

crickman commented 3 months ago

Yes. As the history for a ChatCompletionAgent grows, the ability to truncate according to various strategies becomes increasingly useful.