Advanced System Integration: Analyzing OpenAPI Chunking for Retrieval-Augmented Generation
作者: Robin D. Pesl, Jerin G. Mathew, Massimo Mecella, Marco Aiello
分类: cs.SE, cs.AI
发布日期: 2024-11-29 (更新: 2025-07-28)
备注: This preprint has not undergone peer review (when applicable) or any post-submission improvements or corrections. The Version of Record of this contribution is published in Advanced Information Systems Engineering. CAiSE 2025. Lecture Notes in Computer Science, vol 15702. Springer, Cham., and is available online at https://doi.org/10.1007/978-3-031-94571-7_8
期刊: Advanced Information Systems Engineering. CAiSE 2025. Lecture Notes in Computer Science, vol 15702. Springer, Cham
DOI: 10.1007/978-3-031-94571-7_8
💡 一句话要点
提出基于RAG的OpenAPI分块方法,优化LLM系统集成中的端点发现。
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 检索增强生成 OpenAPI 系统集成 端点发现 大型语言模型 服务组合 API文档 分块策略
📋 核心要点
- 现有系统集成方法在处理动态环境和大型API文档时面临挑战,特别是LLM的token输入限制。
- 论文提出基于RAG的OpenAPI分块策略和发现代理,旨在减少输入token长度,同时保留关键信息,提升端点发现效率。
- 实验结果表明,基于LLM和格式特定的分块方法优于传统方法,且发现代理能进一步提升RAG性能,在token计数、精确率和F1分数上均有改善。
📝 摘要(中文)
为了创建先进的信息系统(ISs),集成多个(子)系统至关重要。主要困难在于集成IS生命周期中的动态环境。传统方法是使用注册表提供系统端点的API文档。大型语言模型(LLMs)已经能够基于这些文档自动创建系统集成(例如,作为服务组合),但由于输入token的限制,特别是对于全面的API描述,需要简洁的输入。目前,尚不清楚如何最好地预处理这些API描述。在这项工作中,我们(i)分析了检索增强生成(RAG)在端点发现中的应用,以及OpenAPI的分块(即预处理),以减少输入token长度,同时保留最相关的信息。为了进一步减少组合提示的输入token长度并改进端点检索,我们(ii)提出了一个发现代理,该代理仅接收最相关端点的摘要,并按需检索详细信息。我们使用RestBench基准评估RAG在端点发现中的应用,首先针对不同的分块可能性和参数,测量端点检索的召回率、精确率和F1分数。然后,我们使用相同的测试集评估发现代理。通过我们的原型,我们展示了如何成功地使用RAG进行端点发现以减少token计数。虽然召回率、精确率和F1值都很高,但仍需要进一步研究以检索所有必需的端点。我们的实验表明,对于预处理,基于LLM的和特定于格式的方法优于朴素的分块方法。依赖代理进一步增强了这些结果,因为代理将任务分解为多个细粒度的子任务,从而提高了token计数、精确率和F1分数方面的整体RAG性能。
🔬 方法详解
问题定义:论文旨在解决大型语言模型(LLMs)在系统集成中,由于API文档过大导致token数量超出限制,从而影响端点发现和系统组合的问题。现有方法,如直接使用完整的API文档,会超出LLM的输入限制,而简单的分块方法可能丢失关键信息,影响检索效果。
核心思路:论文的核心思路是利用检索增强生成(RAG)框架,结合OpenAPI的分块预处理,以及一个发现代理,来优化端点发现过程。通过RAG,可以从分块后的API文档中检索相关信息,减少输入token数量。发现代理则负责接收端点摘要,并按需检索详细信息,进一步降低token数量,并提高检索精度。
技术框架:整体框架包含以下几个主要模块:1) OpenAPI文档分块模块:将大型OpenAPI文档分割成更小的块,以便RAG处理。2) 检索模块:使用RAG从分块后的文档中检索与查询相关的端点信息。3) 发现代理:接收端点摘要,并根据需要检索详细信息。4) LLM:利用检索到的信息进行系统集成或服务组合。
关键创新:论文的关键创新在于:1) 提出了基于LLM和格式特定的OpenAPI分块方法,相比于朴素分块,能更好地保留关键信息。2) 引入了发现代理,通过摘要和按需检索,进一步减少了输入token数量,并提高了检索精度。3) 将RAG应用于系统集成中的端点发现,为解决LLM的输入限制问题提供了一种新的思路。
关键设计:论文中涉及的关键设计包括:1) 不同的OpenAPI分块策略,包括基于LLM的分块和基于格式的分块。2) 发现代理的实现细节,包括如何生成端点摘要,以及如何按需检索详细信息。3) RAG框架的具体配置,包括检索模型的选择和参数设置。论文使用RestBench基准进行评估,并采用召回率、精确率和F1分数作为评估指标。
📊 实验亮点
实验结果表明,基于LLM和格式特定的分块方法优于朴素分块方法,在端点检索的召回率、精确率和F1分数上均有提升。引入发现代理后,RAG的整体性能进一步提高,在token计数、精确率和F1分数方面均有改善。具体数值提升幅度未知,但论文强调了代理在分割任务和提高RAG性能方面的作用。
🎯 应用场景
该研究成果可应用于自动化系统集成、服务组合、API管理等领域。通过优化端点发现过程,可以降低系统集成的复杂性和成本,提高开发效率。未来,该方法有望应用于更复杂的分布式系统和微服务架构中,实现更智能化的系统集成。
📄 摘要(原文)
Integrating multiple (sub-)systems is essential to create advanced Information Systems (ISs). Difficulties mainly arise when integrating dynamic environments across the IS lifecycle. A traditional approach is a registry that provides the API documentation of the systems' endpoints. Large Language Models (LLMs) have shown to be capable of automatically creating system integrations (e.g., as service composition) based on this documentation but require concise input due to input token limitations, especially regarding comprehensive API descriptions. Currently, it is unknown how best to preprocess these API descriptions. Within this work, we (i) analyze the usage of Retrieval Augmented Generation (RAG) for endpoint discovery and the chunking, i.e., preprocessing, of OpenAPIs to reduce the input token length while preserving the most relevant information. To further reduce the input token length for the composition prompt and improve endpoint retrieval, we propose (ii) a Discovery Agent that only receives a summary of the most relevant endpoints and retrieves details on demand. We evaluate RAG for endpoint discovery using the RestBench benchmark, first, for the different chunking possibilities and parameters measuring the endpoint retrieval recall, precision, and F1 score. Then, we assess the Discovery Agent using the same test set. With our prototype, we demonstrate how to successfully employ RAG for endpoint discovery to reduce the token count. While revealing high values for recall, precision, and F1, further research is necessary to retrieve all requisite endpoints. Our experiments show that for preprocessing, LLM-based and format-specific approaches outperform naïve chunking methods. Relying on an agent further enhances these results as the agent splits the tasks into multiple fine granular subtasks, improving the overall RAG performance in the token count, precision, and F1 score.