Quick Start
1
Enable Reflection
2
With Configuration
How Reflection Works
The Reflection Process
| Phase | What Happens | Purpose |
|---|---|---|
| Generate | Create initial response | First attempt |
| Evaluate | Assess quality, accuracy, completeness | Find issues |
| Improve | Refine based on feedback | Better output |
| Repeat | Continue until satisfactory or max iterations | Quality assurance |
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
min_iterations | int | 1 | Minimum reflection cycles |
max_iterations | int | 3 | Maximum reflection cycles |
llm | str | None | LLM for reflection (uses agentβs LLM if not set) |
prompt | str | None | Custom reflection prompt |
Reflection Depth
Light Reflection
Standard Reflection
Thorough Reflection
Custom Reflection Prompts
Customize what the agent evaluates:When to Use Reflection
β Use Reflection For
- Content writing
- Code generation
- Technical documentation
- Research summaries
- Customer-facing content
β Skip Reflection For
- Real-time chat
- Simple lookups
- Time-critical responses
- Trivial questions
Reflection vs Planning
| Aspect | Planning | Reflection |
|---|---|---|
| When | Before execution | After generation |
| Purpose | Decompose task | Improve output |
| Focus | Strategy | Quality |
| Iterations | Once | Multiple |
Best Practices
Set appropriate iteration limits
Set appropriate iteration limits
More iterations = better quality but slower. Use
max_iterations=3 for most tasks, increase for critical content.Use custom prompts for domain-specific evaluation
Use custom prompts for domain-specific evaluation
Generic reflection may miss domain-specific issues. Customize the prompt for your use case.
Combine with planning for complex tasks
Combine with planning for complex tasks
Use planning to break down the task, then reflection to ensure quality output.

