Reflection (Agent)
The gap between a first draft and a good one is usually not more knowledge — it is rereading what you wrote. Reflection gives an agent that same second pass: after producing an output or finishing a step, it examines its own work, names what is wrong with it, and revises.
How a reflection step is built
It is a deliberate extra turn in the loop, not an instruction to be careful:
- Generate — produce the answer, the code, the plan.
- Critique — a separate call whose only job is to find flaws, often against explicit criteria.
- Revise — regenerate with the critique in context.
Separating the critic from the generator matters. A model asked to produce and judge in one breath approves its own work; handed the output as something to review, it is far more willing to find fault with it.
What it fixes and what it cannot
Reflection earns its keep where mistakes are detectable from the artefact itself — a plan missing a step, code that ignores an edge case, an argument that contradicts itself. It is strongest when the critique can cite real evidence: a failing test, a compiler error, a tool's error message. Without that grounding it degrades into self-congratulation, and repeated rounds can talk a correct answer into a worse one. Each round also costs a full model call, so practical loops cap the number of passes and stop as soon as the critique returns nothing substantive. Reflexion extends the idea by keeping those critiques in memory across attempts rather than discarding them.
Reflection is an agent step in which the model examines its own output, identifies flaws and revises — a deliberate generate, critique, revise cycle rather than an instruction to be careful. Keeping the critique as a separate call makes the model far more willing to find fault. It improves work whose errors are visible in the artefact, and is strongest when the critique can cite real evidence such as a failing test; each round costs another model call.
Nobody sends a first draft. You write it, read it back, wince at a sentence, and fix it. The second pass is where most of the quality comes from.
Reflection is that habit, built into an AI agent. After it produces something — a plan, some code, a piece of writing — it is asked to look at its own work, say what is wrong with it, and try again.
It helps most when there is real evidence to go on, like a test that failed. Without that, an agent reviewing itself can simply decide it did well — which is why these second passes are limited rather than endless.