GraphCogent: Overcoming LLMs' Working Memory Constraints via Multi-Agent Collaboration in Complex Graph Understanding

Rongzheng Wang, Qizhi Chen, Yihong Huang, Yizhuo Ma, Muquan Li, Jiakai Li, Ke Qin, Guangchun Luo, Shuang Liang · DOI

Abstract

Large Language Models (LLMs) often struggle with complex graph reasoning due to inherent working memory limitations. GraphCogent is a multi-agent framework designed to address these constraints by mimicking human cognitive processes—sensing, buffering, and executing. By decomposing graph tasks into specialized modules, GraphCogent enables smaller models (e.g., Llama3.1-8B) to outperform significantly larger models like DeepSeek-R1 on complex graph benchmarks while reducing token costs by up to 80%.

The Working Memory Bottleneck in Graph Reasoning

While LLMs demonstrate proficiency in simple graph tasks, their performance degrades as graph scale and reasoning complexity increase. This failure is attributed to a "working memory" constraint: as the model processes more information or takes more reasoning steps, it loses track of the global topology.

This phenomenon is analogous to the N-back task in human psychology, where a participant's ability to recall items from a sequence drops as the distance (N) increases. The authors introduce the Graph N-back task to quantify this in LLMs. As shown in the comparison below, LLMs exhibit a similar decay in recall accuracy for edge existence after only a few dialogue turns.

The Graph N-back task demonstrates how LLMs, like humans, struggle to retain topological information as the sequence of queries progresses.

Traditional approaches like Chain-of-Thought (CoT) often fail due to error propagation in long chains, while rigid tool-based methods struggle with diverse graph representations.

The GraphCogent Framework

Inspired by the human Working Memory Model, GraphCogent decomposes graph reasoning into three specialized modules:

1. Sensory Module

The Sensory Module acts as the system's "eyes." A Sensory Agent samples subgraphs and transforms unstructured text into standardized adjacency lists. To optimize the trade-off between accuracy and computational cost, the framework utilizes the Graph Efficiency Coefficient (GEC). This metric helps determine the ideal "chunk size" for processing—for instance, identifying a 50-edge window as optimal for Llama3.1-8B.

The Graph Efficiency Coefficient (GEC) helps identify the optimal sampling granularity by balancing credit (accuracy) against computational cost.

2. Buffer Module

The Buffer Module serves as episodic memory. It stores standardized graph data in multiple optimized formats (e.g., NetworkX for algorithmic tasks, PyG for neural predictions). By externalizing this data, the LLM is relieved of the burden of maintaining the entire graph structure within its context window, preventing memory decay.

3. Execution Module

The Execution Module coordinates reasoning and action. An Execution Agent determines whether to utilize existing tools or request new ones. If a task falls outside the current toolset, a Tool Creator generates a task-specific Python script. To enhance reliability, the agent is trained using Capability-Margin Preference Optimization (CMPO), which helps it accurately identify the boundaries of its capabilities and avoid "hallucinating" tool functions.

Performance and Key Insights

The framework was evaluated on Graph4real, a new benchmark featuring graphs with up to 1,000 nodes across various domains (Web, Transportation, Social, Citation).

  • Superior Accuracy: GraphCogent (Llama3.1-8B) achieved 98.5% accuracy on in-toolset tasks, significantly outperforming larger models.
  • Scalability: While massive models like DeepSeek-R1 saw performance drop to ~47% on 100-node graphs, GraphCogent maintained near-perfect performance.
  • Token Efficiency: The modular approach reduced input token usage by up to 80% by avoiding the repetitive transmission of large graph descriptions.
  • Robustness to Representation: Unlike naive LLMs that struggle with "wordy" linguistic descriptions of graphs, GraphCogent's sensory transformation ensures stability across different input formats.

Conclusion

GraphCogent demonstrates that multi-agent collaboration and externalized memory buffers can effectively overcome the working memory limitations of LLMs in complex reasoning tasks. By focusing on modular sensing and execution, the framework provides a scalable and cost-effective solution for real-world graph understanding.

Summary updated

BibTeX
@inproceedings{wang2026graphcogent,
  author = {Rongzheng Wang and Qizhi Chen and Yihong Huang and Yizhuo Ma and Muquan Li and Jiakai Li and Ke Qin and Guangchun Luo and Shuang Liang},
  title = {{GraphCogent: Overcoming LLMs' Working Memory Constraints via Multi-Agent Collaboration in Complex Graph Understanding}},
  booktitle = {The Web Conference},
  year = {2026},
  doi = {10.1145/3774904.3792314},
}
Figure