Configure agents that execute sub-agents in iterative loops for continuous refinement and improvement
exit_loop
tool. During sub-agent configuration, you define which ones have the power to stop the loop.exit_loop
toolexit_loop
function accepts no arguments. It simply signals that the loop should stop.
loop_output
will be used to generate the final response presented to the user at the end of the loop.loop_output
:
loop_output
- Sub-agent that generates final response presented to userloop_output
as output_key{{output_key_name}}
in instructions to access dataloop_output
consolidates the final responseIdeal Scenarios
When NOT to use
1. Start creation
2. Configure basic information
3. Configure loop sub-agents
exit_loop
tool🎯 Final Response: One sub-agent must have output_key: "loop_output"
to generate final responseContent refinement example:4. Define coordination instructions
5. Configure sub-agent Output Keys
loop_output
- Sub-agent that generates final response presented to user6. Configure loop stop control
exit_loop
Tool:During sub-agent configuration, you select which ones can use the exit_loop
tool. Only enabled sub-agents have the power to stop the loop.Configuration in interface:Loop Structure
content_generator
Generates or refines content based on feedback
current_content
quality_analyzer
Evaluates content quality across multiple dimensions
quality_analysis
feedback_collector
Identifies specific improvements based on analysis
improvement_feedback
criteria_checker
Decides whether to continue iterating or use exit_loop
stop_decision
final_consolidator
Generates consolidated final response for user
loop_output
⭐Loop Structure
LLM Agent
Analyze request {{user_input}} and previous performance: {{previous_performance}}. Adjust parameters to improve results.
current_parameters
Task Agent
{{current_parameters}}
simulated_performance
A2A Agent
{{simulated_performance}}
detailed_analysis
LLM Agent
Based on analysis {{detailed_analysis}}, if improvement < 5% use exit_loop.
optimization_decision
LLM Agent
Based on complete optimization {{current_parameters}} and {{detailed_analysis}}, present final result for {{user_input}}.
loop_output
⭐Loop Structure
LLM Agent
Based on request {{user_input}}, generate code for: {{requirements}}. If there are errors in {{test_results}}, fix them.
current_code
Workflow Agent
(Sequential)test_results
A2A Agent
{{current_code}}
quality_analysis
LLM Agent
Analyze results {{test_results}} and quality {{quality_analysis}}. If all tests passed and quality >= 8, use exit_loop.
final_check
LLM Agent
Present final code {{current_code}} with documentation based on {{test_results}} and {{quality_analysis}} for {{user_input}}.
loop_output
⭐Output Key Configuration
Data Flow Between Agents
{{code}}
to access previous agent result{{tests}}
to access test results{{requirements}}
to access initial dataOutput Keys Best Practices
analysis_result
, processed_data
quality_feedback
instead of feedback
How to use exit_loop tool
Time Control
Convergence Monitoring
Loop Performance
Memory Management
Loop Dashboard
Loop Debugging
Effective Loop Design
Convergence Optimization
Robustness and Reliability