This is a translated and edited overview of a zhichai.net forum post discussing the paper *Causal Episodic Memory for Feedback-Driven Agent Repair* (August 2026), which proposes MERIT (Memory-Augmented Error-Typed Retrieval) — an 'experience hard drive' for AI agents that stores by error type and retrieves by causal structure.
Paper link: https://arxiv.org/abs/2608.05906
The Problem: Stateless Repair vs. Memory-Aided Repair
Humans retrieve memories by causal structure, not timeline: after fixing a threading bug once, an experienced developer recognizes 'this looks like the same class of problem.' AI agents lack this. Current Text-to-SQL repair systems are largely stateless — they regenerate from scratch on error, forgetting both prior fixes and prior dead ends.
Text-to-SQL is an ideal testbed because:
- Errors are classifiable (syntax, table/column name, JOIN, aggregation errors, etc.)
- Fixes are verifiable (just run the SQL)
- Error types recur across different queries
- Typed positive/negative memory: Positive memory stores Oracle-verified correct fixes ('error type X, fix Y worked'); negative memory stores failed directions ('error type X, fix Z didn't work') — like a veteran engineer's notebook of pitfalls as well as solutions.
- Type-conditional retrieval: Filter by error type first, then semantic retrieval within the type, avoiding cross-type mismatches (e.g., syntax-error fixes retrieved for logic errors).
- Causal temporal constraint: Only *completed* episodes may enter memory. An in-progress repair cannot serve as a memory source because its outcome is unknown.
- Concept over numbers: MERIT opens a structured design space — error type × positive/negative experience × temporal constraints.
- Negative experience is an original contribution: it is the first method to systematically store and exploit failed repair directions, mirroring how human experts know what *not* to try.
- Honest reporting is itself a contribution: it warns the community that memory-augmented repair is not a silver bullet under current classifier accuracy.
Prior memory approaches fall short: storing the last N conversations is too coarse; semantic retrieval (Dynamic RAG) loses causal structure and only stores successful cases — but 'this path doesn't work' is also valuable experience.
MERIT's Core Design
Results: Honest Good and Bad News
| Method | Spider (EX) | BIRD (EX) | |--------|-------------|-----------| | Iterative repair baseline | 66.34% | 47.35% | | MERIT | 69.79% | 48.44% | | Dynamic RAG | 69.51% | 48.16% |
MERIT gains +3.45pp on Spider and +1.09pp on BIRD over the stateless baseline. However, the margin over Dynamic RAG is only 0.28pp on both benchmarks — within statistical noise. The paper honestly reports that MERIT and Dynamic RAG are essentially on par, rather than cherry-picking a favorable framing.
Why doesn't MERIT clearly beat Dynamic RAG?
1. The error classifier is only 48% accurate — so nearly half the time, type-conditional retrieval filters by the wrong type. 2. Query-order sensitivity: the memory grows dynamically, so results depend on the order errors are encountered. 3. No cost advantage: maintaining and retrieving memory adds overhead without clearly better returns.
Why It Still Matters
Conceptual Positioning
MERIT is a new instance of a 'granularity isomorphism' principle: the granularity of optimization should match the granularity of the object being optimized. Related prior work includes Heddle and CodeRescue (decision granularity at trajectory/recovery-action level), ACE's RPI workflow (per-stage context compression), and Regression Tax (paired evaluation structure). MERIT refines memory granularity from 'case-level' to 'error type × positive/negative experience'.
It also fits the 'change the level at which you solve the problem' lineage: like slime mold externalizing memory into slime trails, MERIT externalizes experience into an external memory store rather than fine-tuning model weights. But the honest results also remind us that level-switching doesn't always pay off immediately.
Limitations and Future Directions
1. Error classification is the bottleneck: at 48% accuracy, type-conditional retrieval is wrong nearly half the time. Raising it to 80%+ could let MERIT significantly outperform Dynamic RAG. 2. Text-to-SQL only: error types there are well-structured; transfer to code generation or math reasoning is unverified. 3. Cold start: no strategy discussed for when the memory is empty. 4. Capacity management: no forgetting/compression policy as the memory grows.
Conclusion
The most memorable takeaway is a design principle: memory is not just about *what* to store, but *how* to store it and *when* it can be retrieved. MERIT attempts to move agents from 'remembering answers' to 'also remembering pitfalls' — and knowing what not to do is often worth more than knowing what to do.
---
Paper link: https://arxiv.org/abs/2608.05906 Categories: cs.CL, cs.AI