Skip to content

MemTrace: State-Consistent Memory for Long-Horizon Coding Agents

Oct 2026 · 0 citations · 42 references
Computer Science

TL;DR

MemTrace is a provenance-aware memory system that preserves execution history and aligns its reuse with the evolving task (e.g., iterative cross-file repair) and repository state and retrieves only what the next action requires.

Abstract

As coding agents take on long-horizon software evolution tasks spanning multiple files and stages, longer execution trajectories introduce two coupled challenges: (1) accumulated histories strain context budgets, and (2) repository changes can invalidate earlier execution evidence. Existing approaches address these challenges through techniques like larger context windows, compression, retrieval, or repository representations, but often fail to reconstruct a consistent task state after a context refresh or verify whether recalled evidence remains valid. Thus, we introduce MemTrace, a provenance-aware memory system that preserves execution history and aligns its reuse with the evolving task (e.g., iterative cross-file repair) and repository state. MemTrace stores history as immutable Memory Traces anchored to key information (e.g., files, symbols, tests), and organizes their execution order and dependencies in a Memory Trace Graph. When context is constrained, working memory retains only compact Memory Anchors, from which the agent can reconstruct the latest execution state and locate evidence relevant to its next action. Before restoring historical evidence, MemTrace checks its validity against the current repository state and retrieves only what the next action requires. Across three complementary long-horizon coding benchmarks, MemTrace consistently outperforms all fully evaluated baselines under the same backbone and harness, improving DeepSWE pass@1 by 21.2 points, SWE-EVO Resolved Rate by 4.4 points, and SWE-Milestone Score by 17.8 points under Codex CLI.

View source

Similar papers

FlowState: Execution State as Memory for Long-Horizon LLM Agents

Compared with a full-context baseline using the same DeepSeek-V4-Flash model, FlowState improves the average success rate on MemoryArena and the average pass rate on $\tau^3$-Bench by 4.55 and 13.95 percentage points, respectively, while reducing total token consumption.

Ming-Hao Li, Bang-Yan Li, Zi-Fan Wang et al. · 2 citations
Book Open access Nov 2026

MemDTG: Dynamic Temporal Memory Graphs for Evidence-Admissible Agent Memory

Long-term agent memory is an online, non-monotonic retrieval problem. New interactions may reinforce, contradict, supersede, specialize, abstract, or expire earlier memories; the same fact can be a wrong current answer, a correct historical answer, or necessary transition evidence depending on query intent. Existing ch...

Ya-Xin Deng, Hong-Chao Qin, Tian-Yi Gao et al. · 0 citations
#artificial intelligence Preprint Oct 2026

MemScope: Evolving Agent Memory Architectures through Localized Code Repair

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 s...

Miao Su, Yu-Can Guo, Zi-Xuan Li et al. · 1 citation
Sep 2026

TRACE: Governing Memory Validity in Evolving Multi-Agent Systems

TRACE is presented, a training-free layer that treats re-entry as an eligibility decision rather than a storage or retrieval operation, reconciling a departure checkpoint against absence-period updates, resolving explicit and implicit invalidation, and releasing a bounded Return View only when it covers the returning r...

Wen-Jun Xiong, Shengtao Zhang, Shangding Gu et al. · 0 citations

StateComp: Learning When to Compress History in Long Horizon Agents

This work proposes State Conditioned Compression (StateComp), a framework that determines when historical interactions can be safely compressed according to the current agent state, and demonstrates that it reduces total agent and summarization tokens while maintaining task performance, and achieves a 12.67-fold speedu...

Ming-Xuan Wang, Hong-Yue Chen, Ying-Long Guo et al. · 3 citations
#artificial intelligence Preprint Sep 2026

MemAgent: Learning to Manage Heterogeneous Memory Providers for LLM Agents

MemAgent, featuring a content-aware routing architecture and a training-data synthesis pipeline, is proposed, featuring a content-aware routing architecture and a training-data synthesis pipeline that improves average accuracy and outperforms every individual memory method across all three benchmarks.

Yong-Xian Wei, Yi-Lin Zhao, Run-Xi Cheng et al. · 0 citations

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.