# AnyTool: Self-Reflective, Hierarchical Agents for Large-Scale API Calls

**Authors:** Yu Du, Fangyun Wei, Hongyang Zhang  
**arXiv:** [2402.04253](https://arxiv.org/abs/2402.04253)  
**Date:** 2024-02-06  
**Summary page:** https://www.summarizepaper.com/en/paper/2402.04253v1/

## Key points

- Authors Yu Du, Fangyun Wei, and Hongyang Zhang introduce AnyTool, a large language model agent for API calls
- AnyTool leverages over 16,000 APIs from Rapid API to address user queries
- Key components of AnyTool include an API retriever with a hierarchical structure, a solver for resolving queries using selected APIs, and a self-reflection mechanism
- AnyTool relies on the function calling feature of GPT-4, eliminating the need for training external modules
- The authors introduce an additional benchmark called AnyToolBench to address limitations in existing evaluation protocols
- Experimental results show that AnyTool outperforms strong baselines like ToolLLM by +35.4% in average pass rate on ToolBench
- The code for AnyTool will be available on GitHub at https://github.com/dyabel/AnyTool

## Summary

In their paper titled "AnyTool: Self-Reflective, Hierarchical Agents for Large-Scale API Calls," authors Yu Du, Fangyun Wei, and Hongyang Zhang introduce AnyTool - a groundbreaking large language model agent aimed at revolutionizing the utilization of a wide range of tools to address user queries. Leveraging over 16,000 APIs from Rapid API, the researchers operate under the premise that a subset of these APIs could potentially provide solutions to user queries. AnyTool is built on three key components: an API retriever with a hierarchical structure, a solver designed to resolve user queries using a selected set of API candidates, and a self-reflection mechanism that reactivates AnyTool if the initial solution proves impracticable. What sets AnyTool apart is its reliance on the function calling feature of GPT-4, which eliminates the need for training external modules. The authors also revisit existing evaluation protocols and identify limitations that artificially inflate pass rates. To address this issue and better reflect real-world application scenarios, they introduce an additional benchmark called AnyToolBench. Experimental results across various datasets showcase the superiority of AnyTool over strong baselines like ToolLLM and a GPT-4 variant tailored for tool utilization. For instance, AnyTool outperforms ToolLLM by an impressive +35.4% in terms of average pass rate on ToolBench. The code for AnyTool will be made available on GitHub at https://github.com/dyabel/AnyTool. Overall, this research presents a significant advancement in the field of large-scale API calls by introducing an innovative agent like AnyTool that demonstrates remarkable performance improvements over existing models.
