.Net: Python: Multi-Agent Orchestration Termination Strategy Support
Summary
The current multi-agent orchestrations (specifically MagenticOne) lack termination strategy functionality that exists in AutoGen and Semantic Kernel AgentGroupChat, leading to token consumption issues and poor user experience.
Problem Description
When using MagenticOne orchestration, I encounter the following issues:
- Infinite loops: The orchestrator runs in a never-ending loop until it solves the user's task, consuming excessive tokens and requiring manual termination
- Inadequate max_round_count behavior: When using the
max_round_countparameter and the limit is reached, the final response is not a summarized output of the task but just the response from the final agent the orchestrator called - Missing termination conditions: Unlike AutoGen, there's no built-in way to define custom termination conditions for multi-agent orchestrations
Current Workaround
Currently, I have to manually monitor and terminate processes, which is not practical for production use cases.
Proposed Solution
Implement termination strategy functionality for Multi-Agent Orchestrations similar to what's available in:
- AutoGen's termination conditions
- AgentGroupChat's termination features
Environment
- Python
Additional Context
This feature exists in AgentGroupChat but is missing from multi-agent orchestrations, creating inconsistency in the framework's capabilities.
Questions
- Is this feature planned for implementation?
- Are there any existing examples or workarounds for implementing custom termination strategies?
@TaoChenOSU - This applies to both .NET and Python
Related to #12687
Hi @vamsithumma2812,
Thank you for your questions and feature request!
Yes, the feature request for termination strategies is planned and it's in our backlog. We will get to it ASAP.
To answer your other questions:
- Depending on the language you use, you can set the following properties on the manager to prevent infonite loops:
- C#:
MaximumInvocationCountorMaximumResetCount(to be used withMaximumStallCount) - Python:
max_reset_countormax_round_count(to be used withmax_stall_count)
- C#:
- As explained in #12687, we cannot synthesize the answer as we don't know if the context produced so far is good enough to be synthesized. Instead, we log an error message and return the most recent agent response if available or a clear description that some limit has been reached.
This issue is stale because it has been open for 90 days with no activity.