{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "Reflexion",
 "ref": "Reflexion#81eb",
 "hash": "sema:Reflexion#mh:SHA-256:81eb9140703ea95f53556741df731af84c1cada66cc1e0f3a1d88e4de5fe54d8",
 "stub": "81eb",
 "layer": "Mind",
 "type": "Reasoning",
 "summary": "Self-critique and retry after failure",
 "mechanism": "A self-improvement loop where after completing a Task#a850 attempt, the agent generates linguistic self-critique analyzing what went wrong with the Plan#246d regarding the Goal#986b, 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#626c memory buffer, using this feedback to improve the next attempt.",
 "invariants": [
  "Memory of error persists",
  "Self-correction based on past failure"
 ],
 "parameters": {},
 "signature": [],
 "preconditions": [
  "Failed trial",
  "Outcome#7537 signal"
 ],
 "postconditions": [
  "Improved policy/next trial"
 ],
 "failure_modes": [
  "Shallow Reflection: Critique#646b 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."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "Reflexion",
 "builds_on": [
  {
   "alias": "scratchpad",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Scratchpad",
   "ref": "Scratchpad#626c",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Scratchpad"
  },
  {
   "alias": "plan",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Plan",
   "ref": "Plan#246d",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Plan"
  },
  {
   "alias": "goal",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Goal",
   "ref": "Goal#986b",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Goal"
  },
  {
   "alias": "outcome",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Outcome",
   "ref": "Outcome#7537",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Outcome"
  },
  {
   "alias": "critique",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Critique",
   "ref": "Critique#646b",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Critique"
  },
  {
   "alias": "task",
   "relation": "accepts",
   "library": "bootstrap",
   "slug": "Task",
   "ref": "Task#a850",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Task"
  }
 ],
 "related": [
  {
   "alias": null,
   "relation": "related",
   "library": "bootstrap",
   "slug": "EvaluatorOptimizer",
   "ref": "EvaluatorOptimizer#6c2d",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/EvaluatorOptimizer"
  }
 ],
 "used_by": [
  {
   "slug": "ChainOfThought",
   "relation": "composes_with",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/ChainOfThought"
  },
  {
   "slug": "DogfoodFirst",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/DogfoodFirst"
  },
  {
   "slug": "MetaCheck",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/MetaCheck"
  },
  {
   "slug": "OptimisticSolver",
   "relation": "composes_with",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/OptimisticSolver"
  },
  {
   "slug": "PolymorphicSolver",
   "relation": "composes_with",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/PolymorphicSolver"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/Reflexion",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/Reflexion.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
