用图结构提升大模型工具调用的准确率,解决依赖关系遗漏问题。
Graph RAG-Tool Fusion
- 将向量检索与图遍历结合,捕捉工具间的依赖关系。
- 在两个基准测试中,比传统方法提升71.7%和22.1%(mAP@10)。
- 适合需要复杂工具链调用的智能代理系统开发者。
近年来,基于检索增强生成(RAG)的工具选择技术使大语言模型代理能够从数百甚至数千个外部工具、API或代理中调用复杂功能。然而,传统RAG方法无法捕捉工具间的结构化依赖关系,导致关键依赖工具检索不全。例如,“获取股票价格”API需依赖“获取股票代码”API,并共同依赖操作系统级网络连接工具。本文提出Graph RAG-Tool Fusion,一种即插即用的新方法,结合向量检索与高效图遍历,在预定义的工具知识图谱中同时捕获相关工具节点及其嵌套依赖边。我们还构建了ToolLinkOS,一个包含573个虚构工具、覆盖15个行业、平均每个工具有6.3个依赖关系的新工具选择基准。实验表明,Graph RAG-Tool Fusion在ToolLinkOS和ToolSandbox基准上分别实现71.7%和22.1%的绝对提升(mAP@10)。ToolLinkOS数据集已开源:https://github.com/EliasLumer/Graph-RAG-Tool-Fusion-ToolLinkOS。
原文摘要 · Abstract (English)
Recent developments in retrieval-augmented generation (RAG) for selecting relevant tools from a tool knowledge base enable LLM agents to scale their complex tool calling capabilities to hundreds or thousands of external tools, APIs, or agents-as-tools. However, traditional RAG-based tool retrieval fails to capture structured dependencies between tools, limiting the retrieval accuracy of a retrieved tool's dependencies. For example, among a vector database of tools, a "get stock price" API requires a "stock ticker" parameter from a "get stock ticker" API, and both depend on OS-level internet connectivity tools. In this paper, we address this limitation by introducing Graph RAG-Tool Fusion, a novel plug-and-play approach that combines the strengths of vector-based retrieval with efficient graph traversal to capture all relevant tools (nodes) along with any nested dependencies (edges) within the predefined tool knowledge graph. We also present ToolLinkOS, a new tool selection benchmark of 573 fictional tools, spanning over 15 industries, each with an average of 6.3 tool dependencies. We demonstrate that Graph RAG-Tool Fusion achieves absolute improvements of 71.7% and 22.1% over naïve RAG on ToolLinkOS and ToolSandbox benchmarks, respectively (mAP@10). ToolLinkOS dataset is available at https://github.com/EliasLumer/Graph-RAG-Tool-Fusion-ToolLinkOS
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。