Loading…
Loading…
Written by Max Zeshut
Founder at Agentmelt
An agent architecture pattern where the AI generates an initial output, then evaluates that output against criteria (accuracy, completeness, safety, style) and iterates to improve it before delivering the final result. Reflection mimics human self-review: write a draft, re-read it critically, fix issues, and submit the polished version. Agents using reflection produce higher-quality outputs on complex tasks—especially code generation, legal analysis, and content creation—at the cost of additional inference time and tokens.
A coding agent generates a function, then reflects: 'Does this handle edge cases? Is it efficient? Does it follow the project's style guide?' It identifies a missing null check, adds it, and re-verifies before submitting the pull request.