Home / Patterns

WTF is Reflection?

mainstreamFirst seen 20 Mar 2023

An agent reviews its own output or failed attempt, writes down what went wrong, and tries again.

Also called: reflexion, self-critique, self-reflection

TL;DR

Instead of accepting the first draft, the agent critiques it ("the tests failed because I forgot the edge case"), keeps that lesson, and makes a better second attempt. It is a cheap way to improve quality without retraining the model.

How it works

Reflexion formalised this: after a trial, the agent gets feedback (test results, an evaluator score, environment signals), generates a verbal self-reflection, stores it in an episodic memory buffer, and conditions the next attempt on it. Related variants include evaluator–optimizer loops, where a second model or prompt grades the output and the first revises until a bar is met.

Origin

Coined / introduced by
Shinn et al.
When
20 Mar 2023
Story
Introduced as 'Reflexion: Language Agents with Verbal Reinforcement Learning'.

Related jargons

Sources