arXiv:2506.19998cs.CL2025-06被引 3

从文档自动生成可调用工具的智能代理,提升真实场景应用效率

Doc2Agent: Scalable Generation of Tool-Using Agents from API Documentation

  • 基于文档自动构建可执行工具,通过代码代理迭代优化
  • 在WebArena上性能提升55%,成本降低90%
  • 适用于复杂领域如糖材料科学,具强泛化能力

REST API在扩展网页代理动作空间方面发挥关键作用,但现有基于API的代理多依赖预设统一工具集,无法反映真实世界API的复杂性。为任意领域构建工具使用代理仍是重大挑战,需处理非结构化API文档、测试接口并推断正确参数。我们提出Doc2Agent,一种可扩展的流水线,用于从API文档生成可调用的Python工具型代理。该方法从文档生成可执行工具,并利用代码代理进行迭代优化。我们在真实世界API、WebArena API及研究类API上评估,成功生成经验证的工具。在WebArena基准测试中,相比直接调用API,性能提升55%,成本降低90%。针对糖材料科学构建的领域专用代理进一步验证了该流水线在知识密集型任务中的适应性。Doc2Agent为大规模生成基于非结构化文档的工具代理提供了通用解决方案。

原文摘要 · Abstract (English)

REST APIs play important roles in enriching the action space of web agents, yet most API-based agents rely on curated and uniform toolsets that do not reflect the complexity of real-world APIs. Building tool-using agents for arbitrary domains remains a major challenge, as it requires reading unstructured API documentation, testing APIs and inferring correct parameters. We propose Doc2Agent, a scalable pipeline to build agents that can call Python-based tools generated from API documentation. Doc2Agent generates executable tools from API documentations and iteratively refines them using a code agent. We evaluate our approach on real-world APIs, WebArena APIs, and research APIs, producing validated tools. We achieved a 55\% relative performance improvement with 90\% lower cost compared to direct API calling on WebArena benchmark. A domain-specific agent built for glycomaterial science further demonstrates the pipeline's adaptability to complex, knowledge-rich tasks. Doc2Agent offers a generalizable solution for building tool agents from unstructured API documentation at scale.

工具代理API自动化代码生成可扩展性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。