NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Tool Graph Retriever: Exploring Dependency Graph-based Tool Retrieval for Large Language Models

Linfeng Gao, Yaoxiang Wang, Minlong Peng, Jialong Tang, Yuzhe Shang, Mingming Sun, Jinsong SuarXiv 2025

Abstract

With the remarkable advancement of AI agents, the number of their equipped tools is increasing rapidly. However, integrating all tool information into the limited model context becomes impractical, highlighting the need for efficient tool retrieval methods. In this regard, dominant methods primarily rely on semantic similarities between tool descriptions and user queries to retrieve relevant tools. However, they often consider each tool independently, overlooking dependencies between tools, which may lead to the omission of prerequisite tools for successful task execution. To deal with this defect, in this paper, we propose Tool Graph Retriever (TGR), which exploits the dependencies among tools to learn better tool representations for retrieval. First, we construct a dataset termed TDI300K to train a discriminator for identifying tool dependencies. Then, we represent all candidate tools as a tool dependency graph and use graph convolution to integrate the dependencies into their representations. Finally, these updated tool representations are employed for online retrieval. Experimental results on several commonly used datasets show that our TGR can bring a performance improvement to existing dominant methods, achieving SOTA performance. Moreover, in-depth analyses also verify the importance of tool dependencies and the effectiveness of our TGR.

Introduction

As Large Language Model (LLM) agents are increasingly equipped with vast libraries of external tools (APIs), the challenge shifts from tool execution to tool selection. Since context windows are finite, agents rely on retrievers to identify relevant tools. However, current state-of-the-art retrievers focus almost exclusively on semantic similarity. This approach often fails when a task requires a chain of dependent tools. For instance, a query to "Update my email" might semantically match an UpdateEmail tool but fail to retrieve necessary prerequisites like Validate or Login because their descriptions lack the keyword "email."

The semantic gap in traditional tool retrieval: prerequisite tools like 'Validate' and 'Login' are missed due to low semantic similarity with the query.

The Tool Graph Retriever (TGR) Framework

To address this "semantic gap," we propose the Tool Graph Retriever (TGR). TGR models tools as a dependency graph, allowing the retriever to recognize that certain tools are functionally linked even if they are semantically distinct. The framework operates in three distinct stages:

  1. Dependency Identification: We utilize a BERT-based discriminator trained on a new dataset, TDI300K, to identify functional dependencies between tools (e.g., Tool A requires the output of Tool B). This dataset was built using a pipeline involving LLMs to generate and validate dependent tool documentation from real function implementations.
  2. Graph-Based Tool Encoding: Candidate tools are represented as nodes in a directed graph where edges signify dependencies. We apply a simplified Graph Convolutional Network (GCN) to propagate information across these edges. This process "smooths" tool embeddings, ensuring that a tool's representation incorporates the context of its prerequisites.
  3. Online Retrieval: User queries are matched against these updated, graph-aware embeddings. Prerequisite tools naturally receive higher similarity scores because their representations have been enriched by the tools they support.
The three-stage TGR framework: 1) Dependency Identification, 2) Graph-Based Tool Encoding via GCN, and 3) Online Retrieval with updated representations.

Experimental Evaluation

We evaluated TGR using three primary datasets: TDI300K (for discriminator training), API-Bank (a comprehensive benchmark), and ToolBench (a large-scale instruction-tuning dataset featuring over 16,000 real-world APIs).

Key Results

  • State-of-the-Art Performance: TGR consistently outperformed existing dominant methods across various metrics, including Recall and NDCG. When combined with existing retrievers like ToolBench-IR, TGR achieved SOTA results.
  • Improved Task Success: On the API-Bank dataset, TGR significantly boosted the Pass Rate@10 from 0.624 to 0.788. This indicates that the agent is much more likely to successfully complete a task when it has access to the full chain of required tools.
  • Robustness: The graph-based approach proved effective even with imperfect dependency identification, demonstrating the inherent value of modeling tool relationships. The authors also found a direct correlation between "graph density" and the performance gain of TGR.

Conclusion

TGR demonstrates that a tool's utility is defined not just by its description, but by its position within a functional ecosystem. By integrating dependency information into tool representations via graph convolutions, TGR bridges the gap between semantic search and functional requirements, paving the way for more reliable and capable AI agents.

Summary updated

BibTeX
@misc{gao2025tool,
  author = {Linfeng Gao and Yaoxiang Wang and Minlong Peng and Jialong Tang and Yuzhe Shang and Mingming Sun and Jinsong Su},
  title = {{Tool Graph Retriever: Exploring Dependency Graph-based Tool Retrieval for Large Language Models}},
  year = {2025},
  eprint = {2508.05152},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.05152},
}
Figure