Reflexion is an agentic cognitive architecture that implements verbal reinforcement learning by converting scalar failure signals into linguistic self-feedback. Unlike traditional reinforcement learning that updates model weights, Reflexion stores reflective critiques in an episodic memory buffer, allowing the agent to condition future reasoning on past mistakes without gradient-based optimization.
Glossary
Reflexion

What is Reflexion?
An agentic framework that uses verbal reinforcement learning, where an agent reflects on task failure signals stored in episodic memory to improve its reasoning and decision-making on subsequent attempts.
The framework operates through a three-component loop: an Actor generates text and actions, an Evaluator produces a heuristic reward signal, and a Self-Reflection module synthesizes the failure trajectory into a natural language summary. This verbal feedback is appended to the agent's context window on subsequent trials, enabling iterative improvement on complex tasks like code generation, sequential decision-making, and multi-hop question answering.
Key Features of Reflexion
Reflexion is an agentic framework that uses verbal reinforcement learning, where an agent reflects on task failure signals stored in episodic memory to improve its reasoning and decision-making on subsequent attempts.
Actor-Evaluator Loop
The core architecture separates the Actor (which generates actions and reasoning) from the Evaluator (which provides feedback). The Actor produces a trajectory using an LLM, and the Evaluator scores the outcome. On failure, the Evaluator's scalar reward or textual critique is stored in episodic memory, enabling the Actor to self-correct on the next trial without gradient updates.
Episodic Memory Buffer
Reflexion maintains a persistent episodic memory that stores reflective summaries of past failures. Unlike short-term context windows, this buffer retains lessons across multiple independent trials. Each entry captures:
- The original reasoning trajectory
- The failure signal from the environment
- A verbal self-reflection diagnosing the error This allows the agent to accumulate experiential knowledge over long horizons.
Verbal Reinforcement Signal
Instead of updating model weights through traditional RL, Reflexion uses natural language as the reinforcement signal. The Evaluator generates a textual critique explaining why a trajectory failed. This verbal feedback is more sample-efficient than scalar rewards alone, as it provides dense, semantic guidance that the Actor can parse and act upon in subsequent prompts.
Heuristic-Based Self-Reflection
The reflection generation process follows a structured heuristic. When a task fails, the agent is prompted to analyze:
- What went wrong in the reasoning chain
- Which specific action caused the failure
- What alternative strategy would avoid the error This structured introspection produces actionable insights that are appended to the agent's working memory for the next attempt.
Trial-and-Error Without Fine-Tuning
A defining characteristic of Reflexion is that it improves performance without any gradient-based optimization. The underlying LLM weights remain frozen. All learning occurs through in-context retrieval of past reflections. This makes the framework lightweight, model-agnostic, and immediately deployable with any sufficiently capable language model, avoiding the compute cost of RLHF or fine-tuning.
Application to Decision-Making Tasks
Reflexion was originally demonstrated on sequential decision-making benchmarks including:
- AlfWorld: Embodied household tasks requiring multi-step planning
- HotPotQA: Multi-hop question answering over Wikipedia
- HumanEval: Code generation with unit test feedback In each domain, the agent iteratively refines its policy by reflecting on execution failures, achieving significant gains over baseline ReAct agents.
Reflexion vs. Related Techniques
A feature-level comparison of Reflexion against other iterative self-improvement and reasoning frameworks for large language models.
| Feature | Reflexion | Self-Refine | ReAct |
|---|---|---|---|
Core Mechanism | Verbal RL with episodic memory | Iterative self-critique and revision | Interleaved reasoning and action |
External Memory | |||
Learning Signal | Binary task success/failure | Self-generated textual critique | Environmental observation |
Persistent Improvement Across Episodes | |||
Trial-and-Error Exploration | |||
Heuristic for Self-Evaluation | Rule-based failure detection | LLM-as-judge prompting | Task-specific reward parsing |
Primary Optimization Target | Decision-making and reasoning policy | Single output quality | Task completion trajectory |
Risk of Hallucination Snowballing | Moderate | High | Low |
Frequently Asked Questions
Explore the core mechanisms of the Reflexion agentic architecture, a verbal reinforcement learning paradigm that enables large language models to autonomously improve their reasoning by reflecting on past failures.
Reflexion is an agentic framework that implements verbal reinforcement learning, enabling a large language model (LLM) agent to autonomously improve its decision-making by reflecting on prior task failures. Unlike traditional gradient-based fine-tuning, Reflexion operates entirely in the semantic space of natural language. The process involves a cyclical loop: an Actor agent generates a reasoning trace and action, an Evaluator tests the output and produces a scalar reward or failure signal, and a Self-Reflection module analyzes the sparse feedback to generate a detailed, linguistic critique stored in episodic memory. On subsequent attempts, this textual reflection is injected into the prompt as additional context, guiding the Actor to avoid repeating the same logical errors. This allows the model to learn from trial and error without updating its underlying weights.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Reflexion sits at the intersection of verbal reinforcement learning and agentic cognitive architectures. These related concepts define the mechanisms for self-critique, memory, and iterative improvement in autonomous systems.
Verbal Reinforcement Learning
The paradigm underlying Reflexion where an agent's textual self-critique serves as a reward signal. Unlike traditional RL that uses scalar rewards, verbal RL uses linguistic feedback stored in episodic memory to guide policy improvement. This enables agents to learn from sparse failure signals—like a compiler error or a unit test result—by generating a reflective text summary of what went wrong and why, which is then conditioned on in future trials.
Episodic Memory for Agents
A memory architecture that stores trajectories of agent experiences—sequences of actions, observations, and outcomes. In Reflexion, the agent writes its self-critique into an episodic memory buffer after each trial. On subsequent attempts, the agent retrieves relevant past reflections to avoid repeating mistakes. This differs from semantic memory (facts) and procedural memory (skills), focusing instead on temporally-bound learning events that capture the context of failure.
Self-Refine
An iterative prompting framework where a single LLM generates an initial output, provides its own feedback, and uses that critique to produce a refined version. Self-Refine operates within a single context window without persistent memory, whereas Reflexion maintains a growing episodic memory across multiple trials. Both share the core mechanism of linguistic self-feedback as a driver of improvement, but Reflexion adds a long-term learning loop.
ReAct (Reasoning + Acting)
A prompting paradigm that interleaves reasoning traces and action steps, enabling an LLM to generate task-specific actions and process external observations in a synergistic loop. Reflexion builds on ReAct by adding a post-hoc evaluation phase: after a ReAct trajectory completes, the agent reflects on the full sequence to generate a verbal critique. This critique then informs the reasoning in future ReAct trajectories.
Process Supervision
A training methodology that provides feedback on each intermediate step of a reasoning chain, rewarding correct logical progression rather than just the final outcome. Reflexion's self-generated critiques function as a form of autonomous process supervision—the agent learns to identify which specific step in its reasoning led to failure. This contrasts with outcome supervision, where only the final answer correctness is evaluated.
Faithful Chain-of-Thought
A reasoning trace that accurately reflects the true causal process by which the model arrived at its answer, free from post-hoc rationalization. Reflexion's requirement that the agent critique its own reasoning chain creates pressure toward faithfulness—the agent must accurately report what it did to identify the error. This helps combat the Clever Hans effect, where models rely on spurious correlations for wrong reasons.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us