Causal Episodic Memory for Feedback-Driven Agent Repair
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.
Tom: Next we'll be talking about the paper "Causal Episodic Memory for Feedback-Driven Agent Repair".
Jane: The paper was written by Khang Nhat Hoang Vo, Tam Minh Chu, Anh Trac Duc Dinh, Thuyen Vinh Ha Bui and Tho Quan from Mohamed bin Zayed University of Artificial Intelligence and Ho Chi Minh City University of Technology and Vietnam National University - Ho Chi Minh City.
Tom: Stay tuned as we take you through the paper and discuss its implications.
Title: Tom: "Causal Episodic Memory for Feedback-Driven Agent Repair" is quite a mouthful to start our show with, isn't it, Jane?
Jane: It is certainly a heavy title, Tom, but the concept is actually very intuitive once you peel back the layers.
Tom: You think so? It sounds like something pulled straight from a neurobiology textbook.
Jane: In many ways, it is, because the authors from MBZUAI and HCMUT are essentially trying to give AI agents a way to learn from their own history.
Tom: So instead of just trying a task and then immediately forgetting it, they're building a way for the agent to keep a record of its mistakes?
Jane: Exactly, and that's what the "episodic" part of the title is referring to.
Lu: It's a beautiful direction because it moves us away from static models and toward something that feels much more like a living intelligence.
Tom: I love the vision, Lu, but how do you actually make "learning" happen without retraining the entire model every time it fails?
Meng: That's the part that really caught my eye during my first read.
Meng: If they aren't changing the underlying weights of the model, they must be doing something very clever with how they structure the prompts.
Jane: They are, Meng, and that's where the "feedback-driven" part of the name comes in.
Lalam: This shift toward agents that possess a sense of history could fundamentally change how we perceive technology, turning it from a tool into a partner that grows through experience.
Tom: We're going to break down exactly how that memory is constructed in our next segment.
Summary: Jane: We're getting into the mechanics of "Causal Episodic Memory for Feedback-Driven Agent Repair" now.
Tom: Right, and the heart of this is the MERIT system they've developed.
Jane: It relies on what they call a dual-polarity memory, which is a fancy way of saying it remembers both what worked and what didn't.
Meng: So it isn't just storing successful SQL queries to use as examples?
Jane: No, it specifically stores those "negative" directions that led to errors so the agent knows what to avoid.
Lu: That's brilliant because it prevents the agent from walking down the same dead-end street twice.
Tom: And they use a classifier to label the errors, like if it's a schema problem or a syntax issue?
Jane: Precisely, and that label acts as a guide for their hybrid retriever.
Meng: How does that retrieval process actually work, though?
Jane: It uses a mix of semantic meaning and exact word matching to find the most relevant past experience.
Tom: And the "causal" part means it only looks at memories from episodes that are already finished?
Jane: That's right, it won't look at its own current attempts, only what it has already finalized.
Lalam: By organizing knowledge this way, we're seeing the birth of a form of digital wisdom that can be shared across different tasks.
Tom: Let's see if that wisdom actually leads to better results in the experiments.
Improvements: Tom: Let's look at the actual performance numbers for "Causal Episodic Memory for Feedback-Driven Agent Repair."
Jane: On the Spider benchmark, they saw the execution accuracy jump from sixty-six point three four percent up to sixty-nine point seven nine percent.
Tom: That's a significant improvement, but how did it hold up on the BIRD dataset?
Jane: BIRD was a bit more challenging, but they still saw an increase from forty-seven point three five percent to forty-eight point four four percent.
Meng: I noticed the paper mentions that while it's better than basic iterative repair, it's actually more expensive in terms of token usage.
Tom: That makes sense, because you're feeding all those retrieved memories into the prompt for every repair attempt.
Meng: It's a classic engineering trade-off between higher accuracy and the cost of running the model.
Lu: But the finding that schema-local experience is the most consistent benefit is really the most exciting part.
Jane: It means the agent learns the specific quirks of a database much better than it learns general SQL rules.
Tom: And they compared it to a "Reflexion-style" memory, which actually performed better on BIRD but was way more expensive?
Jane: Yes, MERIT is much more efficient even if it didn't hit those highest peaks on every single test.
Lalam: This kind of reliability is exactly what will eventually allow these agents to be trusted in real-world professional settings.
Tom: We're coming to the end of our time, so let's wrap this all up.
Conclusion: Tom: We've covered a lot of ground today with "Causal Episodic Memory for Feedback-Driven Agent Repair."
Jane: It really is a fascinating step toward agents that don't just act, but actually reflect on the consequences of their actions.
Tom: It's a clever way to implement learning without the massive overhead of retraining.
Lu: I think the potential for agents to develop specialized expertise in very niche, complex domains is just beginning to open up.
Meng: From my side, I'll be watching to see how researchers optimize that token cost for actual production environments.
Lalam: Ultimately, this research shows us how we can build tools that grow alongside us, mirroring our own capacity for learning from failure.
Tom: Thanks for joining us, everyone. Goodbye!
Mohamed bin Zayed University of Artificial Intelligence · Ho Chi Minh City University of Technology · Vietnam National University - Ho Chi Minh City
cs.CL
Submitted: 2026-08-06
Updated: 2026-09-10
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 69/100
The gist: The paper addresses the limitation that "LLM agents that repair failures often discard successful corrections, forcing later episodes to rediscover similar solutions." While existing methods like
Key concepts
- Episodic Memory
- This concept allows AI agents to keep a record of their history, or 'episodes.' Instead of forgetting past attempts, the agent builds a memory of its experiences to improve future performance.
- MERIT System
- The core system developed in the paper. It uses dual-polarity memory—storing both what worked and what failed—to guide agents. It helps prevent the agent from repeating errors by using a classifier and hybrid retriever.
- Dual-Polarity Memory
- A memory structure that remembers two things: successful outcomes and negative directions (errors). Storing these failures is crucial because it allows the agent to know what specific mistakes to avoid.
- Causal Memory
- This refers to the agent only looking at memories from episodes that have already finished. It ensures that the learning process is based on finalized results, not on its current, incomplete attempts.
Terminology
Summary
The paper addresses the limitation that LLM agents that repair failures often discard successful corrections, forcing later episodes to rediscover similar solutions.
While existing methods like Reflexion and ExpeL utilize verbal reflections or natural language knowledge, they do not organize repair memories jointly by the failure that produced them and the outcome of the attempted correction,
which can lead to retrieving irrelevant episodes.
To address this, the authors introduce MERIT (Memory-Augmented Error-Typed Retrieval for Iterative Text-to-SQL repair), a training-free agent that accumulates structured repair experience online.
MERIT maintains an online dual-polarity memory of oracle-verified corrections as positive guidance and observed unsuccessful directions as negative guidance.
The framework is defined by causal
episodic memory, meaning only memories from finalized earlier episodes are eligible for retrieval,
ensuring that the current query cannot access its unfinished trajectory.
The methodology consists of several key components:
-
Failure Diagnosis: A
deterministic classifier assigns a coarse failure type, which conditions a hybrid lexical–dense retriever before the frozen model generates each revision.
The classifier maps unsuccessful queries to categories includingRESULT MISMATCH, SCHEMA LINKING, AGGREGATION, FILTER/VALUE, EXECUTION, SYNTAX, and UNKNOWN.
-
Dual-Polarity Memory: Memory is partitioned into
positive and negative pools.
A "positive entry records an oracle-confirmed failed-to-correct transition y- to y+, [while] a negative entry records the final direction attempted in an unresolved episode, indicating only that it failed in its source context." -
Hybrid Retrieval: The agent uses an
error-guided hybrid retriever
thatranks precedents using lexical and dense signals.
Specifically,Full MERIT ranks candidates by 0.75 times b dense(x, u) + 0.25 times b BM25(x, u),
where the retrieval queryconcatenates the current question, SQL, failure context, and error type.
Experimental results using Qwen2.5-7B-Instruct with identical initial predictions and repair budgets
demonstrate that MERIT improves execution accuracy over stateless iterative repair from 66.34% to 69.79% on Spider and from 47.35% to 48.44% on BIRD.
While Reflexion-style memory reaches 51.24% on BIRD,
it does so at a substantially higher inference cost.
Ablation studies reveal that negative memory contributes modestly, the value of type conditioning and lexical–dense ranking is dataset dependent, and schema-local experience provides the most consistent benefit.
Furthermore, the researchers found that restricting retrieval to memories from other databases lowers accuracy by 0.93 points on Spider and 2.74 points on BIRD,
highlighting that repair patterns do transfer across schemas, but cross-database analogies do not fully replace experience from the target database.
Improvements for AI systems
Improvement: Implementation of a Dual-Polarity, Error-Typed Episodic Memory System
An improved AI agent will transition from stateless iterative reasoning to a Causal Episodic Repair architecture. This involves replacing generic semantic memory with a structured repository that categorizes experiences by failure type, transformation delta, and outcome polarity.
What the improved AI system can do:
-
Execute Dual-Polarity Guidance: The system can simultaneously retrieve
Positive Memories
(verified, successful transformations from previous episodes) to provide a roadmap for correction, andNegative Memories
(observed unsuccessful directions) to act as ado-not-repeat
constraint, preventing the agent from cycling through known failed logic. -
Perform Error-Specific Retrieval: By using a deterministic classifier to map environment feedback (e.g., DBMS error messages) to coarse failure types (e.g.,
SCHEMA LINKING,AGGREGATION,SYNTAX), the system can filter its memory to retrieve only precedents that match the current error category, drastically reducing retrieval noise. -
Utilize Hybrid Lexical-Dense Ranking: The system can perform high-precision retrieval by combining dense embeddings (for semantic similarity of the problem) with BM25 lexical scoring (to ensure exact matches of technical identifiers like table names, column names, and specific SQL keywords), ensuring repairs are syntactically and structurally relevant.
-
Maintain Causal Integrity (Noise Reduction): The system can implement a temporal constraint where only finalized episodes (those that reached a confirmed correct state or exhausted their budget) are written to global memory. This prevents the agent from
learning
and subsequently repeating the errors and hallucinations generated during its own current, unfinished repair attempts. -
Leverage Schema-Local Experience: The system can prioritize
local
repair memories—those derived from the same database schema—allowing the agent to master recurring join paths, complex table relationships, and domain-specific terminology that general-purpose LLM training cannot provide.
Abstract
LLM agents that repair failures often discard successful corrections, forcing later episodes to rediscover similar solutions. We study whether finalized repair outcomes can improve subsequent Text-to-SQL episodes without parameter updates. We introduce MERIT, a training-free agent that maintains an online dual-polarity memory of oracle-verified corrections and observed unsuccessful directions. Under oracle-assisted benchmark feedback, only memories from earlier finalized episodes are eligible for retrieval. A deterministic classifier assigns a coarse failure type, which conditions a hybrid lexical-dense retriever before the frozen model generates each revision. Using Qwen2.5-7B-Instruct with identical initial predictions and repair budgets, MERIT improves execution accuracy over stateless iterative repair from 66.34% to 69.79% on Spider and from 47.35% to 48.44% on BIRD. Paired analyses provide clear evidence for the Spider gain but weaker evidence on BIRD. MERIT is not reliably separated from untyped dynamic retrieval on either benchmark, while Reflexion-style memory reaches 51.24% on BIRD at substantially higher inference cost. Ablations show that negative memory contributes modestly, the value of type conditioning and lexical--dense ranking is dataset dependent, and schema-local experience provides the most consistent benefit. These results clarify when causal cross-query memory improves repair and when broader memory representations remain preferable.
Sources
- SQL-o1: A Self-Reward Heuristic Dynamic Search Method for Text-to-SQL
- MemGPT: Towards LLMs as Operating Systems
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering