Back to glossary

Reflection Pattern

An agent technique where the AI evaluates its own output or reasoning, identifies weaknesses or errors, and generates an improved version. Reflection enables self-correction without external feedback.

The reflection pattern adds a self-evaluation step to agent workflows. After generating an initial output, the agent is prompted to critically review its own work: Is the reasoning sound? Are there errors or omissions? Does the output meet the original requirements? Based on this self-assessment, the agent produces a refined version. This can repeat for multiple rounds of improvement.

For content generation, code writing, and analysis tasks, reflection significantly improves output quality. A marketing copy agent that drafts, critiques, and revises produces noticeably better results than one that generates a single draft. The practical considerations are cost and latency, since each reflection cycle doubles or triples the token usage. Set clear improvement criteria so the agent knows what to look for during reflection, and limit reflection rounds to prevent diminishing returns. Two to three reflection cycles typically capture the majority of quality improvements. Beyond that, you are often paying for marginal gains that a human reviewer could achieve more efficiently.

Related Terms