Reflection Agent Pattern

Agentic AIEvaluationPublished By Simon Budziak

The reflection agent pattern makes an AI agent produce a draft, inspect that draft against explicit criteria, and revise it before returning a result or taking the next action. It trades extra model calls and latency for a chance to catch errors that a one-pass response would leave behind.

The useful version is not vague self-criticism. It is a bounded generate, check, revise loop with a visible definition of done and a maximum number of attempts.

What does a reflection loop actually check?

The agent first creates an answer, plan, or tool result. It then compares that result with factual requirements, constraints, or expected output. The critique must name checks that can fail, such as a missing source, invalid JSON, or a claim unsupported by retrieved evidence. AI agent evals turn those checks into repeatable cases, and an LLM as a judge can assess qualities that do not have a simple deterministic rule.

Why is reflection not enough for risky work?

The same model can generate the error and approve it on review. Use deterministic checks for facts, formats, and permissions whenever they exist. Guardrails should reject unsafe actions before they run, while confidence gating can send unresolved cases to a person. Cap retries as well. A loop that keeps finding minor improvements can turn into cost and delay without improving the outcome.

Frequently asked questions

Can an agent reliably review its own work?

Not by itself. A model can miss the same flaw twice, so the review needs concrete checks, deterministic validation where possible, and an escalation path for important decisions.

When should a reflection loop stop?

Stop when the draft meets defined checks, the retry budget is exhausted, or a person needs to judge a requirement the system cannot verify.

Summarize this page with

See this working in a system we built