Hi-RAG: A Hierarchical Retrieval-Augmented Generation Framework for Scalable and Generalisable Tool Selection in Large Language Model Agents

IF 3.4 4区 计算机科学 Q2 COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE
Expert Systems Pub Date : 2026-06-30 DOI:10.1111/exsy.70341
Wei Tian, Yuhao Zhou
{"title":"Hi-RAG: A Hierarchical Retrieval-Augmented Generation Framework for Scalable and Generalisable Tool Selection in Large Language Model Agents","authors":"Wei Tian,&nbsp;Yuhao Zhou","doi":"10.1111/exsy.70341","DOIUrl":null,"url":null,"abstract":"<div>\n \n <p>As tool repositories for Large Language Model (LLM) agents grow from dozens to hundreds of endpoints, flat retrieval paradigms that treat the repository as an unstructured list suffer from context overload, cross-domain semantic collision and degraded selection accuracy. We propose Hi-RAG, a Hierarchical Retrieval-Augmented Generation framework that exploits the Type <span></span><math>\n <semantics>\n <mrow>\n <mo>→</mo>\n </mrow>\n <annotation>$$ \\to $$</annotation>\n </semantics></math> Service <span></span><math>\n <semantics>\n <mrow>\n <mo>→</mo>\n </mrow>\n <annotation>$$ \\to $$</annotation>\n </semantics></math> Tool structure of the Model Context Protocol (MCP) via a principled coarse-to-fine pipeline. Stage 1 applies a <i>Tool-as-Proxy</i> hybrid retrieval strategy (BM25 sparse retrieval combined with dense bi-encoder search, fused via Weighted Reciprocal Rank Fusion) to identify candidate services efficiently. Stage 2 performs type-aware re-ranking over a local heterogeneous graph, integrating a domain-level gating mechanism with contextualised tool attention for precise service scoring. We further introduce <i>MCPBench</i>, the first benchmark for hierarchical tool selection, comprising 201 tools across 40 real-enterprise services—23% of queries require multi-service reasoning. Experiments across five LLMs show Hi-RAG improves Top-1 accuracy by up to 7.5% (single-service) and 10.0% (multi-service) over Flat-RAG, while reducing token consumption by up to 89% against full-context injection. Comparisons with a strong late-interaction baseline (ColBERT-RAG) further confirm the superiority of Hi-RAG. Zero-shot evaluation on ToolLLM (16,464 tools) confirms scalability, and formal analyses establish <span></span><math>\n <semantics>\n <mrow>\n <mi>O</mi>\n <mfenced>\n <mn>1</mn>\n </mfenced>\n </mrow>\n <annotation>$$ O(1) $$</annotation>\n </semantics></math> context growth with respect to repository size.</p>\n </div>","PeriodicalId":51053,"journal":{"name":"Expert Systems","volume":"43 8","pages":""},"PeriodicalIF":3.4000,"publicationDate":"2026-06-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Expert Systems","FirstCategoryId":"94","ListUrlMain":"https://onlinelibrary.wiley.com/doi/10.1111/exsy.70341","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE","Score":null,"Total":0}
引用次数: 0

Abstract

As tool repositories for Large Language Model (LLM) agents grow from dozens to hundreds of endpoints, flat retrieval paradigms that treat the repository as an unstructured list suffer from context overload, cross-domain semantic collision and degraded selection accuracy. We propose Hi-RAG, a Hierarchical Retrieval-Augmented Generation framework that exploits the Type → $$ \to $$ Service → $$ \to $$ Tool structure of the Model Context Protocol (MCP) via a principled coarse-to-fine pipeline. Stage 1 applies a Tool-as-Proxy hybrid retrieval strategy (BM25 sparse retrieval combined with dense bi-encoder search, fused via Weighted Reciprocal Rank Fusion) to identify candidate services efficiently. Stage 2 performs type-aware re-ranking over a local heterogeneous graph, integrating a domain-level gating mechanism with contextualised tool attention for precise service scoring. We further introduce MCPBench, the first benchmark for hierarchical tool selection, comprising 201 tools across 40 real-enterprise services—23% of queries require multi-service reasoning. Experiments across five LLMs show Hi-RAG improves Top-1 accuracy by up to 7.5% (single-service) and 10.0% (multi-service) over Flat-RAG, while reducing token consumption by up to 89% against full-context injection. Comparisons with a strong late-interaction baseline (ColBERT-RAG) further confirm the superiority of Hi-RAG. Zero-shot evaluation on ToolLLM (16,464 tools) confirms scalability, and formal analyses establish O 1 $$ O(1) $$ context growth with respect to repository size.

Hi-RAG:用于大型语言模型代理中可扩展和可推广的工具选择的分层检索-增强生成框架
随着大型语言模型(LLM)代理的工具库从数十个端点增长到数百个端点,将存储库视为非结构化列表的平面检索范式受到上下文过载、跨域语义冲突和选择准确性降低的影响。我们提出Hi-RAG,一个分层检索-增强生成框架,利用模型上下文协议(MCP)的类型→$$ \to $$服务→$$ \to $$工具结构,通过原则性的粗到细管道。阶段1应用工具即代理混合检索策略(BM25稀疏检索结合密集双编码器搜索,通过加权倒数秩融合融合)来有效地识别候选服务。阶段2在本地异构图上执行类型感知的重新排序,将域级门控机制与上下文化工具关注集成在一起,以实现精确的服务评分。我们进一步介绍了MCPBench,这是分层工具选择的第一个基准,包括40个实际企业服务中的201个工具% of queries require multi-service reasoning. Experiments across five LLMs show Hi-RAG improves Top-1 accuracy by up to 7.5% (single-service) and 10.0% (multi-service) over Flat-RAG, while reducing token consumption by up to 89% against full-context injection. Comparisons with a strong late-interaction baseline (ColBERT-RAG) further confirm the superiority of Hi-RAG. Zero-shot evaluation on ToolLLM (16,464 tools) confirms scalability, and formal analyses establish O 1 $$ O(1) $$ context growth with respect to repository size.
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Expert Systems
Expert Systems 工程技术-计算机:理论方法
CiteScore
7.40
自引率
6.10%
发文量
266
审稿时长
24 months
期刊介绍: Expert Systems: The Journal of Knowledge Engineering publishes papers dealing with all aspects of knowledge engineering, including individual methods and techniques in knowledge acquisition and representation, and their application in the construction of systems – including expert systems – based thereon. Detailed scientific evaluation is an essential part of any paper. As well as traditional application areas, such as Software and Requirements Engineering, Human-Computer Interaction, and Artificial Intelligence, we are aiming at the new and growing markets for these technologies, such as Business, Economy, Market Research, and Medical and Health Care. The shift towards this new focus will be marked by a series of special issues covering hot and emergent topics.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书