Manuscript Offprint

arXiv:2610.21147

All-in-One Memory: Process-Rewarded Reinforcement Learning for Memory Agents

Bingbing Wang, Jingjie Lin, Weiming Qiao, Jing Li, Ruifeng Xu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Large language models increasingly rely on external memory to answer queries grounded in long-horizon histories such as multi-session dialogues and lengthy documents. However, existing memory methods often optimize retrieval and memory construction separately, without a shared reward space for evaluating search, writing, and stopping decisions. To address this, we propose All-in-One Memory (AiO-Mem), which organizes these operations as transitions over a shared evidence state and directly evaluates the semantic quality of each action within a unified reward space. AiO-Mem compiles heterogeneous histories into source-traceable multi-view events, providing a shared substrate for retrieval and memory writing. A unified memory policy actor then rolls out complete interaction trajectories over this shared evidence state. A separate trajectory-conditioned process reward model is trained through evidence-grounded supervised fine-tuning and trajectory-level DPO to assign process scores to the collected trajectories. These scores are aggregated into an action-balanced trajectory reward and used by Process-Aligned DAPO (PA-DAPO) to optimize the memory policy. Across long-context memory benchmarks, AiO-Mem consistently improves answer accuracy over both static memory systems and RL-trained memory agents.

1 INTRODUCTION

Large language models (LLMs) have achieved remarkable progress across diverse natural language processing benchmarks (OpenAI, 2023; Touvron et al., 2023). Yet in long-context, multi-step reasoning scenarios, their static parametric knowledge and limited context windows remain critical bottlenecks (Liu et al., 2024). External memory-augmented architectures have therefore become important extensions of LLMs, ranging from dense retrieval systems (Lewis et al., 2020; Guu et al., 2020) and knowledge-graph memories (Edge et al., 2024) to persistent memory agents (Packer et al., 2023; Chhikara et al., 2025). Such systems rely on tightly coupled memory retrieval and memory construction: retrieval supplies relevant evidence, while construction converts it into compact working memory. Coordinating these stages is challenging because the evolving memory state continually changes what evidence should be searched for, written, or discarded.

Recent studies have introduced reinforcement learning (RL) into memory systems to enable self-improving memory behavior. As illustrated in Figure 1, existing RL-driven memory systems are typically optimized along two separate routes: retrieval-oriented methods, such as Search-R1 (Jin et al., 2025), learn how to search for evidence, while construction-oriented methods, such as Mem- α\alpha (Wang et al., 2025), learn when to insert, update, or merge memory entries. However, these methods still optimize retrieval and construction in isolation, leaving the two stages governed by separate objectives and evaluated through partially disconnected feedback signals. This separation exposes two key limitations. First, there is no shared evidence-state space in which retrieved evidence, written memories, and stopping decisions can be jointly evaluated, making it difficult to coordinate whether the system should continue searching, write a memory, skip redundant information, or stop. Second, existing supervision is largely outcome-centered: it assigns rewards to the final answer but provides little process-level credit for the intermediate memory operations that produced it. As a result, trajectories with the same final-answer score may still differ substantially in evidence relevance, memory faithfulness, redundancy control, and stopping sufficiency; answer correctness alone cannot reliably evaluate the semantic quality of memory operations.

Figure

Figure 1: Comparison of existing RL-driven memory methods and AiO-Mem.

To overcome these limitations, we propose All-in-One Memory (AiO-Mem), which unifies memory retrieval and construction as evidence-state transitions of a single memory-interaction agent, and uses a separate trajectory-conditioned reward model to evaluate the resulting trajectories. AiO-Mem first compiles heterogeneous histories into a traceable multi-view event bank, providing a shared source-grounded substrate for retrieval and memory writing. Built on this event bank, the memory policy actor operates over a shared evidence state and rolls out complete interaction trajectories through two sequential decision steps: decide, which determines whether to continue searching or stop, and extract, which determines whether retrieved candidates should be written into working memory or discarded. A unified process reward model is then trained through evidence-grounded SFT and trajectory-level DPO to assign process scores to each action in the collected trajectories, using rule-derived supervision and reasoning-model scores as complementary training signals. Finally, these process scores are aggregated into an action-balanced trajectory reward. Building on DAPO (Yu et al., 2026b), we propose Process-Aligned DAPO (PA-DAPO) to optimize the memory policy actor. We summarize our primary contributions as follows:

• We propose AiO-Mem, an all-in-one memory agent that unifies retrieval, writing, filtering, and termination within a single evidence-state transition loop. This formulation turns memory retrieval and construction from separately optimized modules into one jointly trainable policy over source-traceable evidence.

• We introduce a trajectory-conditioned unified reward model that directly assesses the semantic quality of each memory action within a shared evidence state, scoring search, add, skip, and stop in a common reward space. Action-balanced aggregation then converts these scores into a trajectory reward for memory-policy optimization with our proposed PA-DAPO.

• We conduct extensive experiments on long-context memory benchmarks, where AiO-Mem consistently improves both answer accuracy and reasoning faithfulness over static memory systems and RL-trained memory agents.

References (33)