Graphs are widely used for modeling relational data in real-world scenarios, such as social networks and urban computing. Existing LLM-based graph analysis approaches either integrate graph neural networks (GNNs) for specific machine learning tasks, limiting their transferability, or rely solely on LLMs' internal reasoning ability, resulting in suboptimal performance. To address these limitations, we take advantage of recent advances in LLM-based agents, which have shown capabilities of utilizing external knowledge or tools for problem solving. By simulating human problem-solving strategies such as analogy and collaboration, we propose a multi-agent system based on LLMs named GraphTeam, for graph analysis. GraphTeam consists of five LLM-based agents from three modules, and the agents with different specialities can collaborate with each other to address complex problems. Specifically, (1) input-output normalization module: the question agent extracts and refines four key arguments from the original question, facilitating the problem understanding, and the answer agent organizes the results to meet the output requirement; (2) external knowledge retrieval module: we first build a knowledge base consisting of relevant documentation and experience information, and then the search agent retrieves the most relevant entries for each question. (3) problem-solving module: given the retrieved information from search agent, the coding agent uses established algorithms via programming to generate solutions, and in case the coding agent does not work, the reasoning agent will directly compute the results without programming. Extensive experiments on six graph analysis benchmarks demonstrate that GraphTeam achieves state-of-the-art performance with an average 25.85% improvement over the best baseline in terms of accuracy. The code and data are available at https://github.com/BUPT-GAMMA/GraphTeam.
翻译:图结构在现实场景(如社交网络与城市计算)中广泛用于建模关系数据。现有基于大语言模型(LLM)的图分析方法或为特定机器学习任务集成图神经网络(GNN),导致可迁移性受限;或完全依赖LLM的内部推理能力,致使性能欠佳。为克服这些局限,我们借助近期在基于LLM的智能体领域取得的进展——该类智能体已展现出利用外部知识或工具解决问题的能力。通过模拟类比、协作等人类问题解决策略,我们提出了一种基于LLM的多智能体系统GraphTeam用于图分析。GraphTeam包含来自三个模块的五个LLM智能体,具备不同专长的智能体可相互协作以处理复杂问题。具体而言:(1)输入输出规范化模块:问题智能体从原始问题中提取并精炼四个关键参数以促进问题理解,答案智能体则按输出要求组织结果;(2)外部知识检索模块:我们首先构建包含相关文档与经验信息的知识库,随后搜索智能体为每个问题检索最相关的条目;(3)问题求解模块:基于搜索智能体检索的信息,编程智能体通过编程调用既有算法生成解决方案;若编程智能体无法运作,推理智能体将直接通过非编程方式计算结果。在六个图分析基准上的大量实验表明,GraphTeam取得了最先进的性能,其准确率较最佳基线平均提升25.85%。代码与数据已发布于https://github.com/BUPT-GAMMA/GraphTeam。