GraphSkill: Documentation-Guided Hierarchical Retrieval-Augmented Coding for Complex Graph Reasoning

Fali Wang, Chenglin Weng, Xianren Zhang, Siyuan Hong, Hui Liu +1 more
2/20/2026
5 citations
cs.SEcs.AIcs.CL
rag

Official code: FairyFali/GraphSkill (6 stars, Python, MIT, last commit 2026-03-13).

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.

Show full abstract

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 {\method}, an \textit{agentic hierarchical retrieval-augmented coding framework} that exploits the document hierarchy through top-down traversal and early pruning, together with a \textit{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, {\dataset}, covering small-scale, large-scale, and composite graph reasoning tasks. Extensive experiments demonstrate that our method achieves higher task accuracy and lower inference cost compared to baselines\footnote{The code is available at \href{https://github.com/FairyFali/GraphSkill}{\textcolor{blue}{https://github.com/FairyFali/GraphSkill}}.}.

View on arXivView PDF

Code Implementations(1)

MIT

Code base for "GRAPHSKILL: Documentation-Guided Hierarchical Retrieval-Augmented Coding for Complex Graph Reasoning"

61Python, ShellFeb 20, 20268 months agoMIT

Similar Papers

Cite this paper

@article{wang2026graphskill,
  title  = {GraphSkill: Documentation-Guided Hierarchical Retrieval-Augmented Coding for Complex Graph Reasoning},
  author = {Fali Wang and Chenglin Weng and Xianren Zhang and Siyuan Hong and Hui Liu and Suhang Wang},
  year   = {2026},
  eprint = {2603.06620},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2603.06620v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2603.06620.svg)](https://codeofpaper.com/paper/2603.06620)

Discussion