Skip to content

QS-Graph: Query-Shot Augmentation and Graph Hyperlink Expansion for Large-Scale Tool Retrieval

Zhoucai Tang, Xiangpeng Li, Yuan Su, Deqiang Ouyang, Ning Wang

cs.CL

Abstract

Large language model (LLM)-based agents increasingly rely on external tools to solve complex tasks, making accurate tool retrieval from large-scale repositories essential. Existing retrieval methods, however, face two key limitations: the semantic mismatch between user queries and tool documents, and the failure to exploit structural dependencies among tools. We introduce QS-Graph, a training-free framework that addresses both limitations. Query-Shot Augmentation adaptively groups example queries into document-anchored intent prototypes, preserving diverse ways in which a tool may be requested. Graph Hyperlink Expansion aggregates these prototypes into a tool-level representation, propagates it over hierarchical and collaborative relations, and injects the resulting structural residual into each prototype. Both enrichment operations are performed at index time, so online retrieval requires only one query encoding, vector search, and lightweight prototype aggregation, without LLM calls or graph traversal. Using query-shots sampled from historical queries, QS-Graph achieves performance competitive with the supervised state of the art on ToolBench without fine-tuning the embedding model. Furthermore, using only synthetic query-shots, QS-Graph outperforms existing baselines across the Web, Code, and Customized domains in ToolRex.

Create a lesson

Metadata

Comments
Accepted by AAAI 2027