GraphSkill: Documentation-Guided Agentic Hierarchical Retrieval-Augmented Coding for Complex Graph Reasoning
Fali Wang, Chenglin Weng, Xianren Zhang, Siyuan Hong, Hui Liu, Suhang Wang
Abstract
The growing demand for automated graph algorithm reasoning has attracted increasing attention in the large language model (LLM) community. Recent LLM-based graph reasoning methods typically decouple task descriptions from graph data, generate executable code augmented by retrieval from technical documentation, and refine the code through debugging. However, we identify two key limitations in existing approaches: (i) they treat technical documentation as flat text collections and ignore its hierarchical structure, leading to noisy retrieval that degrades code generation quality; and (ii) their debugging mechanisms focus primarily on runtime errors, yet ignore more critical logical errors. To address them, we propose GraphSkill, an agentic hierarchical retrieval-augmented coding framework that exploits the document hierarchy through top-down traversal and early pruning, together with a self-debugging coding agent that iteratively refines code using automatically generated small-scale test cases. To enable comprehensive evaluation of complex graph reasoning, we introduce a new dataset, ComplexGraph, covering small-scale, large-scale, and composite graph reasoning tasks. Extensive experiments show that our method achieves higher task accuracy and lower inference cost compared to baselines.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Related papers
- GraphScout: Empowering Large Language Models with Intrinsic Exploration Ability for Agentic Graph ReasoningYuchen Ying, Weiqi Jiang, Tongya Zheng, Yu Wang et al.KDD 2026 · 2 citations
- KG-Agent: An Efficient Autonomous Agent Framework for Complex Reasoning over Knowledge GraphJinhao Jiang, Kun Zhou, Xin Zhao, Yang Song et al.ACL 2025
- GRASP: Graph Reasoning via Agentic Solving and Probing of LLMsXiaojun Guo, Mingxue Tian, Chenheng Zhang, Xiaohan Wang et al.ICML 2026
- You Don't Need Pre-Built Graphs for RAG: Retrieval Augmented Generation with Adaptive Reasoning StructuresShengyuan Chen, Chuang Zhou, Zheng Yuan, Qinggang Zhang et al.AAAI 2026 · 14 citations
- GraphCogent: Mitigating LLMs' Working Memory Constraints via Multi-Agent Collaboration in Complex Graph UnderstandingRongzheng Wang, Shuang Liang, Qizhi Chen, Yihong Huang et al.WWW 2026 · 4 citations
