G-Memory: Tracing Hierarchical Memory for Multi-Agent Systems

Guibin Zhang, Muxin Fu, Guancheng Wan, Miao Yu, Kun Wang, Shuicheng Yan · DOI

Abstract

Multi-agent systems (MAS) powered by Large Language Models (LLMs) have demonstrated significant potential in solving complex tasks through collaboration. However, these systems often lack a robust mechanism for self-evolution—the ability to learn and improve from past experiences. Existing memory architectures designed for single agents fail to scale to MAS due to information overload and a lack of role-specific customization. This paper introduces G-Memory, a three-tier hierarchical graph memory system that captures high-level insights, task metadata, and fine-grained interaction trajectories. By utilizing a bi-directional traversal and graph sparsification, G-Memory provides agents with condensed, role-relevant memories. Our evaluation across five benchmarks shows that G-Memory improves performance by up to 20.89% in embodied tasks while maintaining token efficiency.

Introduction

Large Language Model (LLM) agents are increasingly deployed in Multi-Agent Systems (MAS) to tackle sophisticated problems through division of labor and collaborative reasoning. While single-agent systems have benefited from "self-evolving" memory mechanisms—such as Retrieval-Augmented Generation (RAG) to store past successes and failures—MAS frameworks like AutoGen or MetaGPT lack comparable capabilities.

Adapting single-agent memory to a multi-agent context presents two primary challenges. First, Information Overload: MAS trajectories involve multi-turn dialogues across several agents, often generating ten times the token volume of single-agent tasks, which can overwhelm context windows. Second, Lack of Customization: Agents in a MAS occupy specific roles (e.g., Coder, Reviewer, or Manager). A generic dump of historical logs fails to provide the role-specific guidance necessary for an agent to refine its unique contribution to the team.

The G-Memory Architecture

To address these limitations, we propose G-Memory, a plug-and-play memory architecture inspired by organizational memory theory. G-Memory organizes the history of MAS interactions into a three-tier graph structure:

  1. Insight Graph (Top Tier): This layer stores high-level, abstract rules and generalizable insights extracted from past experiences (e.g., "Always verify item cleanliness before processing").
  2. Query Graph (Middle Tier): This layer stores metadata regarding past tasks and maps the semantic relationships between different queries.
  3. Interaction Graph (Bottom Tier): This layer maintains the fine-grained, step-by-step communication logs and trajectories between agents.

Memory Retrieval and Update

When a MAS encounters a new task, G-Memory identifies similar historical tasks within the Query Graph. It then performs a bi-directional traversal: it moves upward to retrieve abstract strategic insights and downward to extract specific procedural steps from the Interaction Graph. To maintain efficiency, an LLM-based "graph sparsifier" filters the interaction logs, retaining only the core collaborative path. Finally, these retrieved memories are customized for each agent based on their specific role before being injected into the prompt. Post-task, the system updates all three tiers with the new experience, facilitating continuous learning.

Experimental Evaluation

We evaluated G-Memory as a plugin for three MAS frameworks (AutoGen, DyLAN, and MacNet) across five benchmarks in three distinct domains:

  • Knowledge Reasoning: HotpotQA and FEVER.
  • Embodied Action: ALFWorld (household navigation) and SciWorld (science experiments).
  • Strategic Planning: PDDL (strategic games from the AgentBoard benchmark).

Key Results

  • Performance Gains: G-Memory achieved a significant success rate increase of up to 20.89% on embodied tasks (ALFWorld) when paired with MacNet and Qwen-2.5-14b. In reasoning tasks, accuracy improved by up to 10.12%.
  • The Pitfall of Single-Agent Baselines: Interestingly, the study found that applying standard single-agent memory (like Voyager or MemoryBank) to a MAS actually reduced performance in strategic games by up to 4.17%. This suggests that without role-specific cues, generic memory disrupts the specialized division of labor within a team.
  • Ablation Insights: Performance dropped significantly when either the high-level Insight Graph or the low-level Interaction Graph was removed. This confirms that agents require both abstract "why" logic and concrete "how" procedures to evolve effectively.
  • Efficiency: Despite the complexity of the hierarchical structure, G-Memory maintained token usage comparable to or lower than mainstream memory designs due to its intelligent condensation of interaction logs.

Discussion and Limitations

While G-Memory represents a significant step toward self-evolving MAS, several challenges remain. The current evaluation is limited to five benchmarks; further testing in high-stakes domains like medical or legal QA is required. Additionally, there is a risk of error amplification: if an LLM hallucinates or learns an incorrect strategy, the memory system may institutionalize that error, leading to persistent failures. Future work should focus on integrating adversarial robustness checks and alignment safeguards to ensure that the evolving memory remains both accurate and safe.

Conclusion

G-Memory provides a scalable, hierarchical solution for multi-agent memory management. By separating abstract insights from concrete interactions and tailoring retrieval to specific agent roles, it enables MAS to learn from experience without the burden of information overload. This architecture paves the way for more autonomous and capable collaborative AI systems.

Summary updated

BibTeX
@inproceedings{zhang2025g,
  author = {Guibin Zhang and Muxin Fu and Guancheng Wan and Miao Yu and Kun Wang and Shuicheng Yan},
  title = {{G-Memory: Tracing Hierarchical Memory for Multi-Agent Systems}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=mmIAp3cVS0},
}
Figure