Joint Optimization of Multi-agent Memory System

Wenyu Mao, Haoyang Liu, Haosong Tan, Yaorui Shi, Jiancan Wu, An Zhang, Xiang WangarXiv 2026

TL;DR

CoMAM is a novel joint optimization framework for multi-agent LLM memory systems that moves away from training agents in isolation. By modeling the multi-agent pipeline as a sequential Markov Decision Process (MDP) and employing an adaptive credit assignment mechanism, CoMAM allows heterogeneous agents to co-adapt, significantly boosting downstream question-answering accuracy across long conversational histories.

What Problem Does This Paper Address?

To handle long-horizon user interactions beyond standard context windows, modern Large Language Model (LLM) architectures rely on multi-agent memory systems. Typically, these systems split the labor: construction agents compress and format conversational history into structured memory, while retrieval agents fetch relevant pieces to answer downstream queries.

However, existing approaches optimize these agents independently. One agent is trained via reinforcement learning (RL) under a global objective (like final QA accuracy) while treating the other agents as a fixed, static environment. This creates two major bottlenecks:

  1. Lack of Co-adaptation: Independent training ignores inter-agent dependencies. If the construction agent changes how it formats memory, the retrieval agent cannot dynamically adapt to those changes during training.
  2. Ambiguous Credit Assignment: Relying solely on a sparse global reward (e.g., "Did the system get the answer right?") makes it difficult to determine which agent contributed to a success or failure, leading to unstable training.

As a result, even if individual agents look well-trained in isolation, combining them often yields sub-optimal system performance.

Figure 1: (Left) Training curves of coarse/fine memory construction and retrieval agents, which are optimized independently. (Middle) Global system performance under independent and joint optimization across different context lengths. (Right) Conceptual comparison between existing methods that optimize agents independently with shared global rewards and our joint optimization with adaptive credit assignment.

Methods

The authors propose CoMAM (Collaborative Multi-Agent Memory), a framework that jointly optimizes a three-agent memory pipeline:

  • Extraction Agent: Extracts fine-grained, factual memories from raw history.
  • Profile Agent: Abstractly summarizes coarse-grained user preferences and behavioral patterns.
  • Retrieval Agent: Selects relevant memories and generates the final response.

To make these agents work in harmony, CoMAM introduces two core mechanisms:

  1. Inter-agent Dependency Modeling: The authors frame the sequential multi-agent pipeline as a sequential Markov Decision Process (MDP). During end-to-end training, the output of an upstream agent directly becomes the input state for the downstream agent. This explicitly exposes how upstream decisions affect downstream performance.
  2. Adaptive Credit Assignment: Instead of giving every agent the same global reward, CoMAM blends local task-specific rewards (e.g., retrieval precision or information coverage) with the global reward. It uses a ranking-based consistency metric—Normalized Discounted Cumulative Gain (NDCG)—to measure how well an individual agent's local rewards align with global success. Agents whose local choices strongly predict global success receive higher adaptive weights ($w_n$), providing targeted feedback for their specific roles.

The entire pipeline is optimized simultaneously using Group Relative Policy Optimization (GRPO), an efficient RL algorithm that eliminates the need for a separate critic model by using group-based relative rewards.

Figure 2: The overview of our joint optimization framework for the multi-agent memory system, CoMAM, which promotes collaboration among agents via end-to-end reinforcement learning and an adaptive credit assignment mechanism.

Datasets

The framework was evaluated on two long-context conversational benchmarks:

  • PersonaMem: A benchmark featuring long-horizon conversational histories across varying context lengths (32K, 128K, and 1M tokens), paired with seven distinct downstream query types testing factual recall and preference tracking.
  • LongMemEval: A multi-session conversational dataset that requires tracking information and performing temporal reasoning across separate user sessions.

Key Insights and Ideas

  • The Independent Training Trap: Stacking independently optimized agents results in a performance gap. Agents must be allowed to evolve together; a retrieval agent needs to learn the "language" of the evolving construction agent.
  • MDP as a Training Abstraction: Modeling the pipeline as an MDP doesn't mean the agents must be deployed synchronously at inference time. Instead, it serves as a structured training abstraction that allows gradients and rewards to account for inter-agent dependencies.
  • Robustness of Ranking-Based Credit: Rather than using absolute value magnitudes to assign credit—which can be incredibly noisy in LLM outputs—CoMAM relies on relative reward rankings (via NDCG). This ensures stable policy updates even when global rewards are sparse.

Key Results

CoMAM was tested using Qwen and Llama backbones and consistently outperformed both prompt-based and independent RL-based memory baselines:

  • PersonaMem Benchmark: On the Qwen backbone, CoMAM achieved relative accuracy improvements of +8.5% at 32K, +16.7% at 128K, and +10% at 1M context lengths compared to the best-performing baselines.
  • LongMemEval Benchmark: CoMAM achieved state-of-the-art performance across all core metrics ($F_1$, $B_1$, $J_1$), outperforming strong baselines like GAM and Mem0.
  • Training Efficiency: Counterintuitively, joint optimization proved more efficient than independent optimization. Because all agents are updated in parallel rather than sequentially, CoMAM significantly reduced the total number of training convergence steps (e.g., requiring only 68 total steps vs. 160 steps for independent training at the 32K setting).

Limitations and Future Work

The authors note two primary limitations of the current work:

  1. Simplified Agent Design: The system currently focuses on a compact set of core behaviors (extraction, profiling, retrieval). It does not yet explicitly model advanced memory management features like memory editing, consistency maintenance, or redundancy removal.
  2. Limited Cross-Agent Credit Modeling: While CoMAM effectively aligns individual local rewards with the global reward, it does not explicitly model the direct relationships between different agents' local rewards. Exploring these cross-agent dynamics could further improve multi-agent coordination.

Summary updated

BibTeX
@misc{mao2026joint,
  author = {Wenyu Mao and Haoyang Liu and Haosong Tan and Yaorui Shi and Jiancan Wu and An Zhang and Xiang Wang},
  title = {{Joint Optimization of Multi-agent Memory System}},
  year = {2026},
  eprint = {2603.12631},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.12631},
}
Figure