arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.17874cs.SEcs.AI
收藏

利用工具执行后反思与RAG修复工具调用

Repairing Tool Calls Using Post-tool Execution Reflection and RAG

IBM Research(IBM研究院)

Jason Tsay, Zidane Wright, Gaodan Fang, Kiran Kate, Saurabh Jha, Yara Rizk

AI总结:

针对智能体工具调用易出现语义错误的问题,提出结合LLM反思与领域RAG的工具执行后反思组件,在kubectl场景下显著提升命令执行成功率与查询正确率。

摘要:

智能体系统通过调用Python函数、REST API端点或Kubernetes中的kubectl等命令行工具与外部系统交互。这些工具调用常因各种语法和语义原因失败,一些较隐蔽的语义错误只有在分析工具响应后才能识别和解决。为修复这些错误,我们开发了一个工具执行后反思组件,将基于大语言模型(LLM)的反思与领域特定的检索增强生成(RAG)相结合,RAG使用的文档既包含被调用特定工具的说明,也包含与该工具相关的故障排查文档。本文聚焦于使用kubectl命令行工具管理Kubernetes(一个集群应用编排平台)的用例。通过一项较大规模的实证研究和一项较小规模的人工评估,我们发现基于RAG的反思能够修复kubectl命令:在我们评估的模型中,55%的模型的命令执行成功率(通过率)有所提升,且正确回应用户查询的概率平均提高36%。我们还发现,与官方文档相比,故障排查文档平均能将通过率提升10%。

英文摘要:

Agentic systems interact with external systems by calling tools such as Python functions, REST API endpoints, or command line tools such as kubectl in Kubernetes. These tool calls often fail for various syntactic and semantic reasons. Some less obvious semantic errors can only be identified and resolved after analyzing the tool's response. To repair these errors, we develop a post-tool execution reflection component that combines large language model (LLM)-based reflection with domain-specific retrieval-augmented generation (RAG) using documents describing both the specific tool being called and troubleshooting documents related to the tool. For this paper, we focus on the use case of the kubectl command line tool to manage Kubernetes, a platform for orchestrating cluster applications. Through a larger empirical study and a smaller manual evaluation, we find that our RAG-based reflection will repair kubectl commands such that they are both more likely to successfully execute (pass rate) for 55% of our models evaluated and 36% more likely to correctly answer the user query on average. We find that troubleshooting documents improve pass rate compared to official documentation by an average of 10%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑