What is the Reflexion pattern?
A typical agent finishes and calls it a day — wrong or not, it has no idea. Reflexion adds a debrief step: after a run, the model reviews its own work, figures out what went wrong and why, writes those lessons down, then runs again. After a few loops, quality climbs noticeably.How is it different from plain retry?
Plain retry: same thing over againIt just reruns mechanically, learns nothing from the failure, and will likely make the same mistake.
Reflexion: retry with feedback
It first distills the failure into text and feeds it into the next prompt, so the agent tries again with a memory of "where I went wrong last time".
How does it run?
Step one: execute and produceThe agent does the task normally and gets a result.
Step two: self-evaluate
A separate "critic" — or the model itself — checks the result: what's wrong, why, and how to improve it.
Step three: retry with the reflection
The reflection becomes new context, and the agent runs again until the result passes.
Why it matters
Lots of tasks are hard to nail on the first try — writing code, solving math, producing complex text. Reflexion gives an agent the ability to learn from its own mistakes, so it can self-correct without a human in the loop.Bottom line: Reflexion makes an agent "finish, then debrief" — turning mistakes into experience before it tries again.
Comments