MemScope evolves agent memory with precise code repairs
MemScope: Evolving Agent Memory Architectures through Localized Code Repair
Artificial Intelligence
Summary
Sometimes AI agents struggle to remember and reuse information well across different tasks because their memory systems can't change after they're set up. The authors created MemScope, a tool that carefully looks at exactly where an agent's memory system is failing by examining detailed records of what happened during tasks. It then makes small fixes to the memory code so the agent can learn better ways to store and recall information. This approach improved performance on several test tasks, showing that precise, focused updates can make AI memory smarter without big rewrites.
What this means in practice
- •For software developers: Fix and improve AI agent memory modules by automatically identifying and repairing precise code faults from detailed execution logs.
- •For ai product teams: Enhance deployed AI assistants by evolving their memory systems on specific failure cases without large-scale redesigns.$Commercial implications: Enables product teams to offer smarter AI features that adapt efficiently, improving user experience on deployed systems.
Authors
Miao Su, Yucan Guo, Zixuan Li, Long Bai, Zhongni Hou, Xiaolong Jin, Jiafeng Guo
Abstract
Agent memory architectures define how LLM agents store and reuse experience across tasks, but they are typically fixed after deployment, limiting their adaptability across task types. Recent self-evolving approaches instead adapt these memory architectures using execution feedback, typically represented as evaluation scores or compressed summaries. However, such coarse-grained feedback is insufficient for precise failure localization in current agent systems, where long-horizon task execution involves multiple interacting components. Without a precise failure location, existing approaches lack a clear code-level target for modification, leaving the update scope weakly constrained and often leading to large-scale rewrites of an otherwise capable memory architecture. We propose MemScope, a framework for evidence-grounded, localized evolution of an existing memory architecture. Its tool-using Patch Agent jointly inspects raw execution traces, runtime memory state, and current architecture code to identify repair targets and apply bounded, in-place edits under provider-identity and memory-compatibility constraints. On GAIA, the trace-and-memory inspection variant achieves 86.67% accuracy, compared with 70.00% for trace-only and 63.33% for summary-only feedback. Under xBench tasks, the evolved memory architecture improves over its original version from 49 to 55 correct answers with DeepSeek V3.2 and from 50 to 53 with Kimi K2.7 Code. On disjoint ALFWorld unseen tasks, success rises from 50.75% to 71.64%. Across archived architecture-snapshot transitions, the median code-change ratio is 4.4%. These results support fine-grained execution evidence as a basis for localized, in-place memory-architecture evolution.