AnyTool: Universal Tool-Use Layer for AI Agents
$git clone https://github.com/hkuds/anytoolInstalls into the current project.
Install anytool by running `git clone https://github.com/hkuds/anytool`, then use it for the current task and follow its documentation at https://github.com/hkuds/anytool.
| 1 | <div align="center"> |
| 2 | |
| 3 | <picture> |
| 4 | <img src="assets/AnyTool_logo.png" width="800px" style="border: none; box-shadow: none;" alt="AnyTool Logo"> |
| 5 | </picture> |
| 6 | |
| 7 | ## AnyTool: Universal Tool-Use Layer for AI Agents |
| 8 | |
| 9 | ### ✨ **One Line of Code to Supercharge any Agent with <br>Fast, Scalable and Powerful Tool Use** ✨ |
| 10 | |
| 11 | [](https://github.com/HKUDS/AnyTool/) |
| 12 | [](https://www.python.org/) |
| 13 | [](https://opensource.org/licenses/MIT/) |
| 14 | [](./COMMUNICATION.md) |
| 15 | [](./COMMUNICATION.md) |
| 16 | |
| 17 | | ⚡ **Fast - Lightning Tool Retrieval** | 📈 **Self-Evolving Tool Orchestration** | ⚡ **Universal Tool Automation** | |
| 18 | |
| 19 | </div> |
| 20 | |
| 21 | ## 🎯 What is AnyTool? |
| 22 | |
| 23 | AnyTool is a **Universal Tool-Use Layer** that transforms how AI agents interact with tools. It solves three fundamental challenges that prevent reliable agent automation: **overwhelming tool contexts**, **unreliable community tools**, and **limited capability coverage** -- delivering the first truly intelligent tool orchestration system for production AI agents. |
| 24 | |
| 25 | ## 💡 Research Highlights |
| 26 | |
| 27 | ⚡ **Fast - Lightning Tool Retrieval** |
| 28 | - **Smart Context Management**: Progressive tool filtering delivers exact tools in milliseconds through multi-stage pipeline, eliminating context pollution while maintaining speed. |
| 29 | |
| 30 | - **Zero-Waste Processing**: Pre-computed embeddings and lazy initialization eliminate redundant processing - tools are instantly ready across all executions. |
| 31 | |
| 32 | 📈 **Scalable - Self-Evolving Tool Orchestration** |
| 33 | - **Adaptive MCP Tool Selection**: Smart caching and selective re-indexing maintain constant performance from 10 to 10,000 tools with optimal resource usage. |
| 34 | |
| 35 | - **Self-Evolving Tool Optimization**: System continuously improves through persistent memory, becoming more efficient as your tool ecosystem expands. |
| 36 | |
| 37 | 🌍 **Powerful - Universal Tool Automation** |
| 38 | - **Quality-Aware Selection**: Built-in reliability tracking and safety controls deliver production-ready automation through persistent learning and execution safeguards. |
| 39 | |
| 40 | - **Universal Tool-Use Capability**: Multi-backend architecture seamlessly extends beyond web APIs to system operations, GUI automation, and deep research through unified interface. |
| 41 | |
| 42 | ## ⚡ Easy-to-Use and Effortless Integration |
| 43 | |
| 44 | One line to get intelligent tool orchestration. Zero-config setup transforms complex multi-tool workflows into a single API call. |
| 45 | |
| 46 | ```python |
| 47 | from anytool import AnyTool |
| 48 | |
| 49 | # One line to get intelligent tool orchestration |
| 50 | async with AnyTool() as tool_layer: |
| 51 | result = await tool_layer.execute( |
| 52 | "Research trending AI coding tools from GitHub and tech news, " |
| 53 | "collect their features and user feedback, analyze adoption patterns, " |
| 54 | "then create a comparison report with insights" |
| 55 | ) |
| 56 | ``` |
| 57 | |
| 58 | --- |
| 59 | |
| 60 | ## 📋 Table of Contents |
| 61 | |
| 62 | - [🎯 Quick Start](#-quick-start) |
| 63 | - [🚀 Technical Innovation & Implementation](#-technical-implementation) |
| 64 | - [🔧 Configuration Guide](#-configuration-guide) |
| 65 | - [📖 Code Structure](#-code-structure) |
| 66 | - [🔗 Related Projects](#-related-projects) |
| 67 | |
| 68 | --- |
| 69 | |
| 70 | ## 🎯 Quick Start |
| 71 | |
| 72 | ### 1. Environment Setup |
| 73 | |
| 74 | ```bash |
| 75 | # Clone repository |
| 76 | git clone https://github.com/HKUDS/AnyTool.git |
| 77 | cd AnyTool |
| 78 | |
| 79 | # Create and activate conda environment (includes ffmpeg for video recording) |
| 80 | conda create -n anytool python=3.12 ffmpeg -c conda-forge -y |
| 81 | conda activate anytool |
| 82 | |
| 83 | # Install dependencies |
| 84 | pip install -r requirements.txt |
| 85 | ``` |
| 86 | |
| 87 | > [!NOTE] |
| 88 | > Create a `.env` file and add your API keys (refer to `anytool/.env.example`). |
| 89 | |
| 90 | ### 2. Execution Mode: Local vs Server |
| 91 | |
| 92 | AnyTool's Shell and GUI backends support two execution modes. You can configure the |