MemChain: Learning Interpretable Memory Traces for Memory-Augmented LLM Agents

Yiwen Ma, Songjun Tu, Qichao Zhang, Dong Li, Linjing Li +1 more
7/27/2026
cs.AI
rl

No confident code implementation found for this paper.

Abstract

Memory-augmented LLM agents typically answer queries by retrieving relevant memories and feeding them directly to an answer model. This retrieval-as-evidence paradigm assumes retrieved memories are already suitable for reasoning, leaving the answer model to resolve redundancy, conflicts, and weak relevance while incurring substantial context overhead in long-term memory tasks.

Show full abstract

We propose MemChain, a trainable post-retrieval memory policy that transforms retrieved candidates into answer-facing active memory, represented as a compact and grounded evidence context. Given a user query and retrieved candidates, MemChain first generates a question-conditioned evidence plan, then constructs an ordered grounded evidence trace that organizes retrieved memories according to their semantic roles and dependencies, and finally executes explicit memory actions to produce a concise evidence context for answer generation. To train the mediator, we introduce a two-stage learning framework. Supervised trace learning first teaches the policy to generate structurally valid plans, traces, actions, and evidence contexts. We then propose Trace-Guided Memory Policy Optimization (TMPO), a reinforcement learning objective that optimizes the memory policy using downstream answer quality while jointly encouraging trace grounding, evidence support, structural validity, and answer stability across multiple rollouts. Experiments on LoCoMo and LongMemEval-S demonstrate that MemChain consistently achieves state-of-the-art performance across both closed-source and open-weight frozen answer models while substantially reducing the memory context passed to the answer model.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ma2026memchain,
  title  = {MemChain: Learning Interpretable Memory Traces for Memory-Augmented LLM Agents},
  author = {Yiwen Ma and Songjun Tu and Qichao Zhang and Dong Li and Linjing Li and Dongbin Zhao},
  year   = {2026},
  eprint = {2607.24097},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.24097v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.24097.svg)](https://codeofpaper.com/paper/2607.24097)

Discussion