Self Refine Loop
When to Use
- User says self refine or task matches this capability
- User says reflexion loop or task matches this capability
- User says critique and revise or task matches this capability
- User says improve output or task matches this capability
Workflow
- Capture the current output and the user's quality criteria.
- Generate a critique listing specific weaknesses (max 5 bullets).
- Revise the output addressing every critique point.
- Score confidence 0-10 on whether criteria are met.
- Repeat until confidence >= 8 or 5 iterations; return best version with changelog.
Integrations
goal-verifieragentic-uncertainty-quantifierdspy-prompt-optimizer
Error Handling
| Failure | Response |
|---|---|
| No criteria given | Ask user for 1-3 success criteria before looping. |
| Confidence stuck below 5 | Stop early; report blocker and ask for guidance. |
| Output grows unbounded | Cap revisions to prior length + 20%. |
Gotchas
- Do not loop on trivial typos; one-pass fix is enough.
Example
Input: User request matching triggers above. Output: Structured result per workflow with integrations invoked as needed.