Reflection Pattern: Agents That Check Their Own Work
The Reflection pattern adds a self-evaluation step after the agent produces an output. The agent reviews its own work against defined criteria and revises if necessary — before the user sees the result.
What Is the Reflection Pattern?
The Reflection pattern adds a self-evaluation step after the agent produces an initial output. The agent reviews its own work against defined criteria — accuracy, completeness, tone, policy compliance — and revises the output if necessary. The user receives the revised output, not the first draft.
When to Use It
- High-stakes outputs where quality matters more than speed (customer communications, financial summaries, compliance reports)
- Outputs that must meet defined standards (brand guidelines, policy requirements, regulatory formats)
- Complex reasoning tasks where the agent might make mistakes it can catch on review
When NOT to Use It
- Real-time interactions where latency is a concern — reflection adds a full generation cycle
- Simple lookups where the output is a fact, not a judgment
- High-volume, low-stakes tasks where the cost of reflection exceeds the benefit
How It Works
The agent produces an initial output. A reflection prompt then instructs the agent to evaluate that output: "Review the response above. Does it accurately address all parts of the user's question? Is it complete? Does it comply with the company communication guidelines? If not, revise it." The agent produces a revised output. The revision is what the user sees.