AI
New Framework Teaches AI Code Agents to Learn From Experience and Reuse Knowledge
Researchers introduce MemOp, a closed-loop memory system that enables software engineering agents to retain and apply lessons across tasks, improving success rates and reducing costs.
Large language model-powered agents are increasingly tackling real software engineering challenges—but they stumble on a fundamental problem: they have no institutional memory. Each task starts from scratch, forcing these agents to reconstruct context repeatedly and make the same mistakes over and over.
A new research paper presents MemOp, a closed-loop framework designed to give SE agents the ability to accumulate and refine experience across different tasks. Rather than treating each coding job as an isolated episode, the system grounds memory in what actually matters: whether retained knowledge translates into better real-world outcomes.
How MemOp Works#
The framework establishes memory utility through validated downstream impact—measuring what engineers call "signal," meaning evidence that stored knowledge actually improves performance. This dual-purpose approach serves both as a task-agnostic evaluation benchmark and as an optimization signal, removing the need for manual annotation.
The researchers tested MemOp across:
- Four distinct benchmarks
- Three programming languages
- Two different SE agent architectures
They evaluated performance under both single-episode (learning within one task) and cross-episode (applying lessons across multiple tasks) memory augmentation strategies.
Results and Improvements#
The results demonstrate measurable gains across multiple dimensions:
- Success rates improved by up to 5.25 percentage points
- Resolve efficiency climbed as much as 4.63 percentage points
- Deployment costs fell by 10.33% or more
Beyond raw performance metrics, MemOp showed generalizability across different SE agents and memory architectures, as well as transferability—memory models trained on one programming language transferred to unseen languages and different software engineering tasks.
Why It Matters#
Current LLM-based agents remain episodic, lacking a principled way to measure whether memory actually helps. MemOp addresses this by grounding memory utility in downstream impact, making it possible to rigorously evaluate whether retained knowledge truly improves outcomes and to optimize memory use across different agents and settings.

