Reflection: the agent evaluates its own output before continuing. Reflexion (Shinn et al. 2023) added self-critique loops to agents and improved task completion by 10-20 points. Cheap to add, sometimes powerful, occasionally counterproductive.
- 01Structure a reflection step in an agent loop.
- 02Name the specific tasks where reflection helps most.
- 03State the failure modes of reflection.
The pattern
After an action or a candidate answer, insert a reflection step: 'Did the last action achieve the goal? What went wrong? What to try next?' Uses the same model or a different one. Fresh context helps; using the same conversation risks self-approval.
Where it helps
Code generation (does the code run?), math (does the answer check out?), planning (did the last step advance the goal?). Where it hurts: simple retrieval, single-turn Q&A, tasks with unambiguous success criteria. Cap at 2-3 reflection rounds.
- Reflection turns single-shot output into a check-and-revise loop.
- Fresh-context critique beats same-conversation critique.
- Shinn et al., 'Reflexion: Language Agents with Verbal Reinforcement Learning' (2023)