Skip to content

Fix #6227 - Add MessageStore abstraction for external message persistence in all 5 team types#7863

Open
Whning0513 wants to merge 1 commit into
microsoft:mainfrom
Whning0513:fix-issue-6227
Open

Fix #6227 - Add MessageStore abstraction for external message persistence in all 5 team types#7863
Whning0513 wants to merge 1 commit into
microsoft:mainfrom
Whning0513:fix-issue-6227

Conversation

@Whning0513

@Whning0513 Whning0513 commented Jun 19, 2026

Copy link
Copy Markdown

Add MessageStore base class abstraction for storing message thread in teams

Feature request from maintainer ekzhu: Add a simple storage abstraction for message_thread with a TTL policy parameter. This enables teams to persist their message history externally (e.g., to databases or other storage backends) rather than keeping it only in memory.

Filed by: ekzhu (maintainer)

Teams stored message history solely in memory within BaseGroupChatManager. There was no abstraction layer to support external persistence, which limited scalability and recovery capabilities for long-running conversations.

11 files changed, primarily:

File 1: python/packages/autogen-agentchat/src/autogen_agentchat/storage/_message_store.py (new)

  • Created MessageStore base class with TTL policy support
  • Defines the interface for storing and retrieving message threads

File 2: python/packages/autogen-agentchat/src/autogen_agentchat/storage/__init__.py

  • Exported the new MessageStore class

Files 3-11: Team implementations

  • Updated _base_group_chat.py, _base_group_chat_manager.py, _events.py
  • Updated all 5 team types: RoundRobinGroupChat (_round_robin_group_chat.py), SelectorGroupChat (_selector_group_chat.py), SwarmGroupChat (_swarm_group_chat.py), MagenticOneGroupChat (_magentic_one_group_chat.py, _magentic_one_orchestrator.py), DiGraphGroupChat (_digraph_group_chat.py)
  • Each team accepts an optional message_store parameter and uses it for message persistence

Low - The new MessageStore abstraction is entirely opt-in through an optional constructor parameter. Teams that do not provide a message_store continue to use the default in-memory behavior with no changes. New storage implementations can be added without modifying team code.

@Whning0513

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant