Reflexion
Self-critique and retry after failure
Mechanism
A self-improvement loop where after completing a Task attempt, the agent generates linguistic self-critique analyzing what went wrong with the Plan regarding the Goal, then uses this reflection as context for a retry. Unlike fine-tuning, the model is frozen—improvement comes from explicit textual feedback stored in an episodic memory buffer. It writes self-critique to a Scratchpad memory buffer, using this feedback to improve the next attempt.
Invariants
- Memory of error persists
- Self-correction based on past failure
Preconditions
- Failed trial
- Outcome signal
Postconditions
- Improved policy/next trial
Failure modes
- Shallow Reflection: Critique is generic ('try harder') without actionable insight.
- Reflection Drift: Each retry diverges further from the goal.
- Premature Success: Declaring success before the task is actually solved.
Where this came from
—
Builds on
- Scratchpad references
- Plan references
- Goal references
- Outcome references
- Critique references
- Task accepts
Used by
- ChainOfThought composes_with
- DogfoodFirst references
- MetaCheck references
- OptimisticSolver composes_with
- PolymorphicSolver composes_with
Related
Identity
- Ref:
Reflexion#81eb - Hash: sema:Reflexion#mh:SHA-256:81eb9140703ea95f53556741df731af84c1cada66cc1e0f3a1d88e4de5fe54d8
- Library: bootstrap 0.11.0, root a6a3d1ff0f98
- License: Not stated; check the repository