---
library: "bootstrap"
slug: "Reflexion"
name: "Reflexion"
ref: "Reflexion#81eb"
hash: "sema:Reflexion#mh:SHA-256:81eb9140703ea95f53556741df731af84c1cada66cc1e0f3a1d88e4de5fe54d8"
type: "Reasoning"
layer: "Mind"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/Reflexion"
---

# Reflexion

Self-critique and retry after failure

Mind · Reasoning

## Mechanism

A self-improvement loop where after completing a [Task](https://semahash.org/vocabularies/bootstrap/patterns/Task.md) attempt, the agent generates linguistic self-critique analyzing what went wrong with the [Plan](https://semahash.org/vocabularies/bootstrap/patterns/Plan.md) regarding the [Goal](https://semahash.org/vocabularies/bootstrap/patterns/Goal.md), 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](https://semahash.org/vocabularies/bootstrap/patterns/Scratchpad.md) 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](https://semahash.org/vocabularies/bootstrap/patterns/Outcome.md) signal

## Postconditions

- Improved policy/next trial

## Failure modes

- Shallow Reflection: [Critique](https://semahash.org/vocabularies/bootstrap/patterns/Critique.md) 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](https://semahash.org/vocabularies/bootstrap/patterns/Scratchpad.md) (references)
- [Plan](https://semahash.org/vocabularies/bootstrap/patterns/Plan.md) (references)
- [Goal](https://semahash.org/vocabularies/bootstrap/patterns/Goal.md) (references)
- [Outcome](https://semahash.org/vocabularies/bootstrap/patterns/Outcome.md) (references)
- [Critique](https://semahash.org/vocabularies/bootstrap/patterns/Critique.md) (references)
- [Task](https://semahash.org/vocabularies/bootstrap/patterns/Task.md) (accepts)

## Used by

- [ChainOfThought](https://semahash.org/vocabularies/bootstrap/patterns/ChainOfThought.md) (composes_with)
- [DogfoodFirst](https://semahash.org/vocabularies/bootstrap/patterns/DogfoodFirst.md) (references)
- [MetaCheck](https://semahash.org/vocabularies/bootstrap/patterns/MetaCheck.md) (references)
- [OptimisticSolver](https://semahash.org/vocabularies/bootstrap/patterns/OptimisticSolver.md) (composes_with)
- [PolymorphicSolver](https://semahash.org/vocabularies/bootstrap/patterns/PolymorphicSolver.md) (composes_with)

## Related

- [EvaluatorOptimizer](https://semahash.org/vocabularies/bootstrap/patterns/EvaluatorOptimizer.md)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: Reflexion#81eb
- Hash: sema:Reflexion#mh:SHA-256:81eb9140703ea95f53556741df731af84c1cada66cc1e0f3a1d88e4de5fe54d8

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/Reflexion
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/Reflexion.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
