mirror of
https://github.com/microsoft/autogen.git
synced 2025-08-16 12:41:21 +00:00

Closes #4623 ### Add Directed Graph-based Group Chat Execution Engine (`DiGraphGroupChat`) This PR introduces a new graph-based execution framework for Autogen agent teams, located under `autogen_agentchat/teams/_group_chat/_graph`. **Key Features:** - **`DiGraphGroupChat`**: A new group chat implementation that executes agents based on a user-defined directed graph (DAG or cyclic with exit conditions). - **`AGGraphBuilder`**: A fluent builder API to programmatically construct graphs. - **`MessageFilterAgent`**: A wrapper to restrict what messages an agent sees before invocation, supporting per-source and per-position filtering. **Capabilities:** - Supports sequential, parallel, conditional, and cyclic workflows. - Enables fine-grained control over both execution order and message context. - Compatible with existing Autogen agents and runtime interfaces. **Tests:** - Located in `autogen_agentchat/tests/test_group_chat_graph.py` - Includes unit and integration tests covering: - Graph validation - Execution paths - Conditional routing - Loops with exit conditions - Message filtering Let me know if anything needs refactoring or if you'd like the components split further. --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com> Co-authored-by: Leonardo Pinheiro <leosantospinheiro@gmail.com>