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 Su · 2025
Read Tool Graph Retriever: Exploring Dependency Graph-based Tool Retrieval for Large Language Models by Linfeng Gao, Yaoxiang Wang, Minlong Peng, Jialong Tang, Yuzhe Shang, Mingming Sun, Jinsong Su (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-05152.txt.
Introduction
Linfeng Gao, Yaoxiang Wang, Minlong Peng, Jialong Tang, Yuzhe Shang, Mingming Sun, and Jinsong Su wrote a 2025 paper on helping language models pick the right tools. AI agents now carry so many tools that all of their descriptions no longer fit in the model's context. Retrieval must shortlist the tools a task needs.
Most retrievers score each tool on its own by wording match. That misses tools that are needed only because another tool depends on them. The authors build a graph of tool dependencies, trained on a new dataset, and spread that link data through the tool descriptions with graph methods. The enriched scores then rank tools for a query. The aim is a shortlist that includes the hidden prerequisites a task needs to succeed.
Catalog record
| CREATOR | Linfeng Gao, Yaoxiang Wang, Minlong Peng, Jialong Tang, Yuzhe Shang, Mingming Sun, Jinsong Su |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 31 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2508-05152
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
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 Su 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 T ool G raph R etriever (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. 1 Introduction As an important step towards artificial general intelligence (AGI), tool learning expands the ability of LLM-based AI agents and enables them to interact with the external environment. Goertzel 2014 ; Dou et al. 2023 ; McLean et al. 2023 . However, as the number of equipped tools increases rapidly, it has become challenging for LLMs to process all the tool information, primarily due to the context length limitations. Therefore, a typical framework of AI agents employs a retriever to retrieve the candidate tools before the practical task, which involves the following four steps. First of all, relevant tools are retrieved from the equipped tool set according to the task description provided by user. Secondly, the LLM, guided by a delicately-designed prompt and the tool retrieval results, creates a tool-invoking plan as the solution path for the task. Thirdly, it takes actions to invoke tools based on the plan and receives feedback from the tool execution result. Finally, if the task is considered complete, it will generate the final response to the user. Figure 1: An example of dominant tool retrieval process, where some necessary prerequisite tools are omitted due to low semantic similarities. The down arrows \downarrow denote the calling order of the tools. Figure 2: Our proposed TGR involves three steps: (1) Dependency Identification, where we build a dataset for tool dependency identification and train a discriminator; (2) Graph-Based Tool Encoding, where we represent the tools with dependencies as a graph and integrate the dependencies into tool representations with graph convolution; (3) Online Retrieval, where we utilize the updated tool embeddings to compute query-tool similarities as the final retrieval scores. As the first step in the above process, tool retrieval plays a critical role in constructing a high-performing tool-augmented agent. This is because the context length of the model restricts us to using only a limited number of tools. If necessary tools cannot be accurately retrieved, it will result in an execution error. To achieve accurate tool retrieval, prevalent tool retrieval methods primarily focus on the semantic similarities between the tool descriptions and the user queries Patil et al. 2023 ; Li et al. 2023 ; Qin et al. 2023 . They consider each tool independently, which, however, results in the omission of some necessary prerequisite tools during retrieval. For instance, in the example of Figure 1 , the solution path for the query “ Update my email to ‘[email protected]’. ” involves three tools that should be invoked in sequence: “ Validate ”, “ Login ”, and “ UpdateInfo ”. However, the descriptions of tools “ Validate ” and “ Login ”, which are about “ Validate credential ” and “ Login account ”, are semantically irrelevant to the query. As a result, although the invocation of “ UpdateInfo ” depends on the results of “ Validate ” and “ Login ”, only the tool “ UpdateInfo ” can be successfully retrieved. In this paper, we propose T ool G raph R etriever (TGR), which exploits the dependencies between tools to refine the tool retrieval process. As shown in Figure 2 , it involves three steps: (1) Dependency Identification. In this step, we construct a dataset, termed as TDI300K, and train a discriminator to identify the tool dependencies; (2) Graph-Based Tool Encoding. To model the dependencies, we construct a graph with tools as nodes and their dependencies as edges. Then we use graph convolution to integrate the dependencies for a better learning of the tool representations; (3) Online Retrieval. We conduct online retrieval by calculating the query-tool similarity with the updated tool representations. Compared with previous studies Li et al. 2023 ; Qin et al. 2023 ; Patil et al. 2023 , TGR leverages the tool dependencies as additional information to refine the retrieval process, thus leading to better results. Overall, our contributions can be summarized as follows: • We propose T ool G raph R etriever (TGR), leveraging tool dependencies as additional information to improve the performance of tool retrieval. • We construct a tool dependency identification dataset termed TDI300K and subsequently train a discriminator, facilitating the subsequent studies in this area. • Experimental results and in-depth analyses on several commonly-used datasets demonstrate that TGR brings the improvement of Recall, NDCG and Pass Rate to existing dominant methods, achieving state-of-the-art performance on several commonly-used datasets. 2 Related Work Recently, LLMs have demonstrated outstanding abilities in many tasks. Meanwhile, it becomes dominant to equip LLMs with external tools, deriving many tool-augmented LLMs such as Toolformer Schick et al. 2023 , ART Paranjape et al. 2023 and ToolkenGPT Hao et al. 2023 . However, as the number of tools grows rapidly, how to efficiently conduct tool retrieval becomes more important. In this regard, Qin et al. 2023 employ Sentence-BERT Reimers and Gurevych 2019 to train a dense retriever based on a pretrained BERT-base Devlin et al. 2019 . The retriever encodes the queries and tool descriptions into embeddings respectively and selects top- k tools with the highest query-tool similarities. Similarly, Li et al. 2023 and Patil et al. 2023 employ paraphrase-MiniLM-L3-v2 Reimers and Gurevych 2019 and text-embedding-ada-002 1 1 1 https://platform.openai.com/docs/guides/embeddings as the tool retrievers respectively. Besides, Hao et al. 2023 represent tools as additional tokens and finetune the original LLM to autonomously select the tool to be invoked. Unlike the studies mentioned above, Liang et al. 2023 divide tools into different categories to quickly locate relevant ones. They also employ Reinforcement Learning from Human Feedback for the entire task execution, so as to enhance the ability of the tool retriever. Different from the above studies, TGR improves the effectiveness of tool retrieval with tool dependencies as additional information. We first identify the dependencies between tools and model them as a graph. Then, we use graph convolution to integrate the dependencies into tool representations, which are used for final online retrieval. To the best of