BoxAgnts Introduction (2) — AI Agent Toolbox BoxAgnts' Agent Toolbox, the middle layer of the system, comprises six core modules that handle intent understanding, tool dispatching, and execution result feedback. The architecture includes a unified API abstraction layer supporting over 20 model providers through a Provider + Transformer dual-layer design, enabling dynamic provider selection and automatic fallback at runtime. BoxAgnts' middle layer — the Agent Toolbox — is the brain and hands of the system. It consists of six core modules responsible for three things: understanding your intent, dispatching the right tools, and feeding back execution results . This article takes a deep dive into the architectural design and key implementations of each module. What happens when you type "Help me analyze the code structure of this Rust project" in the Dashboard and hit send? User Message │ ▼ ┌─────────────────────────────────────────────────────────────┐ │ boxagnts-api Unified API Abstraction Layer │ │ LlmProvider trait → 20+ Providers → Message Normalization │ ├─────────────────────────────────────────────────────────────┤ │ boxagnts-query Agent Query Loop │ │ run query loop → Multi-turn Conversation → Tool Dispatch → Auto Recovery │ ├─────────────────────────────────────────────────────────────┤ │ boxagnts-tools + tools-manager + wasm-tools │ │ Tool trait → Built-in Tools + WASM Tools → Execution │ ├─────────────────────────────────────────────────────────────┤ │ boxagnts-gateway Gateway & Scheduling │ │ Cron Scheduler + Site Hosting │ ├─────────────────────────────────────────────────────────────┤ │ boxagnts-workspace Memory & Configuration │ │ SQLite + JSON Config + Conversation History │ └─────────────────────────────────────────────────────────────┘ Let's break down each one. This is the interface layer between the middle layer and the external AI world. It solves the most painful problem in AI tool development: every model provider's API is different, but your code should not pay the price for that . LlmProvider Trait: The Foundation of Polymorphism The core interface that all provider adapters must implement: php async trait pub trait LlmProvider: Send + Sync { fn id &self - &ProviderId; // Unique identifier "anthropic", "openai" fn name &self - &str; // Human-readable name // Non-streaming request async fn create message &self, request: ProviderRequest - Result