Tool Graph Retriever (TGR)
- The paper introduces a novel graph-based retrieval framework that models explicit prerequisite relations among tools to ensure operational completeness.
- It employs a parameter-free graph convolutional network to enrich base tool embeddings, efficiently integrating dependency structures from both synthetic and manually annotated data.
- Empirical results on datasets like API-Bank and ToolBench demonstrate significant improvements in Recall@k and Pass Rate@k, validating TGR’s effectiveness in dependency-aware tool selection.
Searching arXiv for the most relevant papers on Tool Graph Retriever and closely related graph-based tool retrieval work. Tool Graph Retriever (TGR) is a graph-based retrieval framework for LLM agents that selects tools by exploiting explicit dependencies among them rather than treating each tool as an isolated document. In its canonical form, TGR models candidate tools as nodes in a directed dependency graph, learns or predicts prerequisite relations between tool pairs, propagates information over that graph via graph convolution, and performs online retrieval using the resulting graph-enhanced tool representations (Gao et al., 7 Aug 2025). The term also admits broader usage in adjacent literature for graph-based retrieval over tools, tool metadata, tool trajectories, or tool–agent hierarchies, but the most direct definition is the dependency-graph retriever introduced in “Tool Graph Retriever: Exploring Dependency Graph-based Tool Retrieval for LLMs” (Gao et al., 7 Aug 2025). Its central motivation is that semantic similarity alone often retrieves the “main” tool named by a query while missing prerequisite tools needed for successful multi-step execution, especially when those prerequisites are semantically distant from the query but structurally necessary (Gao et al., 7 Aug 2025).
1. Conceptual basis and problem formulation
Tool retrieval arises because tool-augmented LLM agents may have access to hundreds or thousands of APIs, functions, or services, while only a small subset can be exposed within the model’s context window during planning and execution (Gao et al., 7 Aug 2025). Conventional retrievers encode user queries and tool descriptions into a shared vector space and return the nearest tools, but these methods assume that tools are independent items. TGR rejects that assumption and instead posits that tools form workflows with prerequisite structure, so retrieval should preserve not only semantic match but also operational completeness (Gao et al., 7 Aug 2025).
The defining notion in TGR is a directed dependency relation between tools. Tool depends on tool if either requires the result of as input, or must be invoked beforehand for verification or preparation (Gao et al., 7 Aug 2025). The paper formalizes three pairwise labels for a tool pair : , , and , corresponding respectively to “ depends on 0,” “no dependency,” and “1 depends on 2” (Gao et al., 7 Aug 2025). In the resulting graph, an edge points from the dependent tool to its prerequisite, so a chain such as UpdateEmail → Login → Validate encodes the order in which prerequisite capability must be supplied (Gao et al., 7 Aug 2025).
This formulation distinguishes TGR from purely semantic tool selection. A query such as “Update my email to '[email protected]'” is semantically close to UpdateEmail, yet correct execution may require Validate and Login, whose descriptions are less lexically aligned with the user utterance (Gao et al., 7 Aug 2025). TGR is designed to retrieve such latent prerequisites by enriching tool representations with graph structure before query matching (Gao et al., 7 Aug 2025).
2. Dependency modeling and the TDI300K supervision corpus
A core difficulty is that tool dependency labels are not typically available in existing benchmarks. To address this, the TGR paper constructs TDI300K, a dataset for training a dependency discriminator (Gao et al., 7 Aug 2025). TDI300K has two components: a balanced synthetic pretraining set derived from code, and a smaller imbalanced finetuning set of manually annotated real tools (Gao et al., 7 Aug 2025).
The synthetic pretraining portion uses CodeSearchNet as a source of real functions and applies a three-agent GPT-3.5-Turbo pipeline (Gao et al., 7 Aug 2025). First, raw function code is converted into a structured API-style document containing name, description, input parameters, and output parameters (Gao et al., 7 Aug 2025). Second, a new dependent tool document is generated so that either the new tool consumes outputs of the original function or produces outputs usable by it, establishing a directional parameter dependency (Gao et al., 7 Aug 2025). Third, another LLM validates whether the pair genuinely satisfies a dependency relation, and only validated pairs are retained (Gao et al., 7 Aug 2025). From these, the authors derive balanced counts for the three labels: 92,000 instances for 3, 92,000 for 4, and 92,000 for 5 (Gao et al., 7 Aug 2025).
The finetuning set uses real tools collected from ToolBench training data, other open-source projects, and libraries, with manual documentation and pairwise annotation within tool sets (Gao et al., 7 Aug 2025). This split is intentionally imbalanced, reflecting that “no dependency” dominates in realistic catalogs. The reported counts are 1,029 for 6, 33,365 for 7, and 1,056 for 8 (Gao et al., 7 Aug 2025). The paper also constructs a validation set from 20% of the finetuning data and a manually annotated API-Bank test set with 60 / 500 / 60 examples for the three categories (Gao et al., 7 Aug 2025).
The dependency discriminator itself is a BERT-base-uncased classifier that encodes the concatenation of two tool documents separated by [SEP] and predicts one of the three directional labels (Gao et al., 7 Aug 2025). Pretraining uses standard cross-entropy, while finetuning adopts category-specific averaging to counter severe class imbalance (Gao et al., 7 Aug 2025). Reported discriminator performance is Precision 0.775, Recall 0.814, F1 0.792 on validation, and Precision 0.893, Recall 0.760, F1 0.817 on test (Gao et al., 7 Aug 2025). These values matter because downstream retrieval quality is strongly dependent on graph quality; when manual dependency graphs are substituted for discriminator-generated ones, retrieval improves further (Gao et al., 7 Aug 2025).
3. Graph construction and representation learning
Once dependencies are predicted, TGR builds a directed tool dependency graph 9, where nodes are tools and edges indicate prerequisite relations (Gao et al., 7 Aug 2025). On API-Bank, 10,439 total tools yield 4,200 connected nodes, for a connected-node ratio of 0.420; on ToolBench, 8,600 tools yield 7,090 connected nodes, for a ratio of 0.824 (Gao et al., 7 Aug 2025). This suggests that ToolBench contains denser operational structure, which later correlates with larger gains from graph-based retrieval (Gao et al., 7 Aug 2025).
Initial node features come from an existing dense retriever. For ToolBench, the paper follows ToolBench-IR to encode structured tool documents. For API-Bank, only tool descriptions are encoded, to mitigate domain mismatch between queries and full tool documents (Gao et al., 7 Aug 2025). The result is a matrix 0, where each row is a tool embedding produced by the base retriever (Gao et al., 7 Aug 2025).
TGR then applies a simplified graph convolutional network without trainable parameters:
1
where 2 is the adjacency matrix of the dependency graph, 3 adds self-loops, and 4 is the degree matrix of 5 (Gao et al., 7 Aug 2025). The updated embedding matrix 6 is therefore a degree-normalized propagation of information from each tool’s neighbors and itself (Gao et al., 7 Aug 2025). Although the graph is directed, the normalization effectively produces a symmetrized propagation scheme with self-loops (Gao et al., 7 Aug 2025).
The decision to remove trainable parameters is central. It avoids extra end-to-end training, keeps online retrieval efficient, and makes TGR retriever-agnostic: the method can be layered on top of any embedding-based tool retriever without retraining the underlying encoder (Gao et al., 7 Aug 2025). Conceptually, graph convolution shifts a tool’s vector toward the semantic region occupied by its prerequisites and dependents. In the account-deletion example, the embedding of GetUserToken becomes closer to queries about account deletion because information propagates from DeleteAccount, which depends on it (Gao et al., 7 Aug 2025).
A closely related alternative appears in “Graph RAG-Tool Fusion,” which does not learn graph-enhanced embeddings but instead combines vector retrieval of primary tools with graph traversal over a predefined dependency graph to retrieve direct and indirect prerequisites (Lumer et al., 11 Feb 2025). That work is relevant because it embodies a traversal-oriented TGR pattern, whereas TGR proper is embedding-centric (Lumer et al., 11 Feb 2025). Another related design is the hybrid ego-graph ensemble retriever for enterprise planning, which retrieves semantic and lexical seed nodes, expands 1-hop ego graphs, and reranks the resulting tool set (Bansal et al., 7 Aug 2025). These variants indicate that the “Tool Graph Retriever” family spans both graph-propagated representation learning and graph-expansion retrieval strategies.
4. Online retrieval pipeline and inference behavior
At inference time, TGR performs retrieval in two phases (Gao et al., 7 Aug 2025). First, the user query is encoded with the same underlying encoder used for tool embeddings, producing a vector 7 (Gao et al., 7 Aug 2025). Second, similarity scores are computed between 8 and each graph-enhanced tool embedding 9, with cosine similarity found empirically to be the best scoring function among cosine, dot product, 0, and 1 (Gao et al., 7 Aug 2025). Tools are ranked by
2
and the top-3 tools are returned (Gao et al., 7 Aug 2025).
The complete offline/online split is concise.
| Phase | Operation | Result |
|---|---|---|
| Offline | Build dependency graph, compute base embeddings, apply graph convolution | Final indexed tool embeddings 4 |
| Online | Encode query, compute cosine scores, rank tools | Top-5 retrieved tools |
Because graph enhancement is precomputed, online latency is essentially that of the base retriever plus a light aggregation step (Gao et al., 7 Aug 2025). The framework is therefore compatible with agents that already have tool-selection infrastructure and only need higher recall of prerequisite tools.
A broader interpretation of TGR appears in “Tool-to-Agent Retrieval,” which embeds both agents and tools in a shared vector space and uses ownership edges to lift tool-level hits into agent-level routing decisions (Lumer et al., 3 Nov 2025). While that framework is not dependency-based, it confirms a general design principle: graph structure over tool ecosystems can be used at retrieval time to augment dense similarity with relational aggregation (Lumer et al., 3 Nov 2025). Likewise, “SIT-Graph” extends graph retrieval into multi-turn settings by storing state summaries on tool-transition edges and switching between procedural edge weights and episodic state-conditioned retrieval (Li et al., 8 Dec 2025). This suggests that TGR’s dependency graph can be seen as the static, single-step special case of a broader class of graph-based tool memory systems (Li et al., 8 Dec 2025).
5. Empirical results and evaluation methodology
TGR is evaluated on API-Bank and ToolBench I1 using Recall@k, NDCG@k, and Pass Rate@k, where Pass Rate measures whether all required tools for a query are present in the top-6 retrieved set (Gao et al., 7 Aug 2025). This last metric is especially important because it operationalizes workflow completeness rather than per-tool relevance (Gao et al., 7 Aug 2025). Formally,
7
where 8 is the gold set of tools and 9 the top-0 retrieval (Gao et al., 7 Aug 2025).
The main results on API-Bank show that adding TGR to Paraphrase-MiniLM-L3-v2 improves Recall@5 from 0.659 to 0.736 and Pass Rate@10 from 0.592 to 0.698 (Gao et al., 7 Aug 2025). Adding TGR to ToolBench-IR improves Recall@5 from 0.714 to 0.761 and Pass Rate@10 from 0.624 to 0.788 (Gao et al., 7 Aug 2025). On ToolBench I1, Paraphrase-MiniLM-L3-v2 rises from Recall@5 0.365 to 0.429 and Pass Rate@10 0.250 to 0.450 with TGR, while ToolBench-IR rises from Recall@5 0.709 to 0.742 and Pass Rate@10 0.690 to 0.730 (Gao et al., 7 Aug 2025). The paper characterizes TGR+ToolBench-IR as achieving state-of-the-art results on both datasets (Gao et al., 7 Aug 2025).
A concise summary of key gains is helpful.
| Dataset | Base retriever | Metric | Base | +TGR |
|---|---|---|---|---|
| API-Bank | PMLM-L3-v2 | Recall@5 | 0.659 | 0.736 |
| API-Bank | PMLM-L3-v2 | Pass Rate@10 | 0.592 | 0.698 |
| API-Bank | ToolBench-IR | Recall@5 | 0.714 | 0.761 |
| API-Bank | ToolBench-IR | Pass Rate@10 | 0.624 | 0.788 |
| ToolBench I1 | PMLM-L3-v2 | Recall@5 | 0.365 | 0.429 |
| ToolBench I1 | PMLM-L3-v2 | Pass Rate@10 | 0.250 | 0.450 |
| ToolBench I1 | ToolBench-IR | Recall@5 | 0.709 | 0.742 |
| ToolBench I1 | ToolBench-IR | Pass Rate@10 | 0.690 | 0.730 |
The paper also measures graph quality sensitivity by replacing automatically predicted dependency graphs with manually annotated ones on API-Bank (Gao et al., 7 Aug 2025). For ToolBench-IR, Recall@5 improves from 0.761 with discriminator-built graphs to 0.788 with manual graphs, and Pass Rate@10 improves from 0.788 to 0.817 (Gao et al., 7 Aug 2025). This confirms that dependency identification is a major bottleneck rather than a peripheral detail (Gao et al., 7 Aug 2025).
Further analysis shows that TGR’s benefit scales with graph density (Gao et al., 7 Aug 2025). Across ToolBench categories, recall improvement correlates roughly linearly with the proportion of connected nodes in the dependency graph (Gao et al., 7 Aug 2025). This suggests that graph propagation is most effective in dependency-intensive environments, while sparse tool catalogs provide fewer relational signals to exploit (Gao et al., 7 Aug 2025).
A complementary benchmark in “Graph RAG-Tool Fusion” evaluates dependency-aware retrieval using mAP@10, with gains of 71.7 percentage points over naive RAG on ToolLinkOS and 22.1 points on ToolSandbox (Lumer et al., 11 Feb 2025). Those results are not directly comparable to TGR because the retrieval mechanics and datasets differ, but they independently support the claim that dependency-aware retrieval improves tool-set completeness (Lumer et al., 11 Feb 2025).
6. Position within the research landscape, variants, and limitations
TGR sits at the intersection of tool-augmented agents, information retrieval, and graph representation learning (Gao et al., 7 Aug 2025). Relative to semantic retrievers, its main contribution is to move from an item-wise retrieval view to a relational view in which tools are embedded as parts of workflows rather than isolated descriptions (Gao et al., 7 Aug 2025). Relative to richer graph-planning systems, TGR remains deliberately lightweight: it augments tool retrieval but does not itself perform explicit multi-step plan generation (Gao et al., 7 Aug 2025).
Several adjacent works illuminate this design space. “Graph RAG-Tool Fusion” represents a retrieval-plus-traversal formulation: vector retrieval identifies primary tools, then graph DFS pulls in direct and indirect dependencies (Lumer et al., 11 Feb 2025). “Planning Agents on an Ego-Trip” builds a knowledge graph over tools, parameters, and entities, then retrieves 1-hop ego-graph ensembles seeded by semantic and lexical node matches (Bansal et al., 7 Aug 2025). “SIT-Graph” extends the graph from tool dependencies to state-integrated transitions for multi-turn agents, augmenting edges with compact state summaries and retrieving next-step tools either by procedural weight or state similarity (Li et al., 8 Dec 2025). “Tool-to-Agent Retrieval” generalizes graph retrieval from tool dependencies to ownership edges in multi-agent systems, enabling joint tool-level and agent-level routing (Lumer et al., 3 Nov 2025). These systems are not equivalent, but together they show that graph retrieval over tool ecosystems can target prerequisites, stateful transitions, or organizational hierarchy depending on the graph semantics (Lumer et al., 11 Feb 2025, Bansal et al., 7 Aug 2025, Li et al., 8 Dec 2025, Lumer et al., 3 Nov 2025).
TGR also contrasts with approaches that internalize tool graphs inside the LLM. “GRAFT” maps each tool to a special token and learns directed tool dependencies in representation space, largely removing external graph retrieval from the inference path (Gao et al., 12 May 2026). This suggests a possible future trajectory in which TGR-like retrievers either become training-time supervision sources or are hybridized with token-level graph-aware decoders (Gao et al., 12 May 2026). A plausible implication is that external graph retrieval remains most attractive when tool catalogs are dynamic, too large to fully internalize, or need explicit interpretability.
The main limitations identified for TGR are threefold (Gao et al., 7 Aug 2025). First, discriminator quality constrains graph quality, and synthetic dependency generation may introduce artifacts (Gao et al., 7 Aug 2025). Second, graph construction is 1 in the number of tools if all tool pairs must be classified, which is acceptable for medium-scale catalogs but problematic at very large scale (Gao et al., 7 Aug 2025). Third, the method is evaluated only on ToolBench I1 among ToolBench difficulty levels, because cross-category graph construction is time-consuming (Gao et al., 7 Aug 2025). The use of a parameter-free GCN also limits representational flexibility relative to learned graph encoders, even if it improves efficiency (Gao et al., 7 Aug 2025).
Several research directions follow naturally from these constraints. Better dependency induction could incorporate structured parameter types or execution traces rather than relying primarily on documentation text (Gao et al., 7 Aug 2025). Candidate-pair pruning before discrimination could reduce the cost of graph construction (Gao et al., 7 Aug 2025). More expressive but efficient graph encoders could replace the single parameter-free propagation step (Gao et al., 7 Aug 2025). Broader graph indexing schemes, such as hierarchical tool-graph encodings inspired by tree-based graph retrieval for textual graphs, may become relevant for very large tool ecosystems (Wei et al., 8 Jan 2026). Another plausible direction is token-efficient graph construction, echoing the philosophy of concept-graph methods such as TERAG, which emphasize minimal LLM output and symbolic graph construction during indexing (Xiao et al., 23 Sep 2025).
In sum, Tool Graph Retriever denotes a retrieval paradigm in which tool selection is grounded in graph structure rather than only semantic similarity. In its canonical dependency-graph formulation, it predicts prerequisite relations, constructs a directed tool graph, propagates tool embeddings over that graph, and retrieves tools using graph-enhanced representations (Gao et al., 7 Aug 2025). Its significance lies less in any single scoring function than in a shift of retrieval objective: from finding individually relevant tools to retrieving complete, executable tool sets. This makes TGR an important building block for scalable LLM agents, especially in domains where missing one prerequisite tool is sufficient to make an otherwise plausible plan fail (Gao et al., 7 Aug 2025).