Quick Start
1
Basic Async Reflection
Enable reflection in async agents with simple boolean flag:
2
Custom Reflection Criteria
Configure reflection with custom criteria for async agents:
How It Works
Self-reflection in async agents follows the same process as sync agents:Feature Parity
Prior to PR #1704, async agents had limited reflection support:Before PR #1704: Only legacy custom-LLM async branch supported reflection; the default OpenAI async path skipped it entirely.After PR #1704: Self-reflection works uniformly in both sync and async agents on all execution paths, including the default unified-dispatch path.
Configuration Options
All reflection configuration options work identically in async agents:Best Practices
Choose Appropriate Limits
Choose Appropriate Limits
Set reasonable
min_reflect and max_reflect values to balance quality with performance. Async reflection still involves multiple LLM calls.Custom Criteria
Custom Criteria
Provide specific evaluation criteria for better reflection quality. Generic criteria like βIs this good?β are less effective than specific requirements.
Monitor Performance
Monitor Performance
Reflection increases response time and token usage. Monitor these metrics in production async applications.
Error Handling
Error Handling
Wrap async reflection calls in try-catch blocks to handle potential timeout or API errors gracefully.
Related
Async Agents
Complete guide to async agent execution
Self-Reflection Concepts
Core concepts and architecture

