Minimal AI agent framework with sandbox execution, tool calling, and MCP support
Project description
Box Agent
English | 中文
Box Agent is a minimal yet professional agent framework that supports multiple LLM providers (Anthropic, OpenAI-compatible, and more). It features interleaved thinking, tool calling, and a robust agent loop for complex tasks.
This project comes packed with features designed for a robust and intelligent agent development experience:
- ✅ Full Agent Execution Loop: A complete and reliable foundation with a basic toolset for file system and shell operations.
- ✅ Persistent Memory: An active Session Note Tool ensures the agent retains key information across multiple sessions.
- ✅ Intelligent Context Management: Automatically summarizes conversation history to handle contexts up to a configurable token limit, enabling infinitely long tasks.
- ✅ Claude Skills Integration: Comes with 15 professional skills for documents, design, testing, and development.
- ✅ MCP Tool Integration: Natively supports MCP for tools like knowledge graph access and web search.
- ✅ Comprehensive Logging: Detailed logs for every request, response, and tool execution for easy debugging.
- ✅ Clean & Simple Design: A beautiful CLI and a codebase that is easy to understand, making it the perfect starting point for building advanced agents.
Table of Contents
- Box Agent
Quick Start
1. Get API Key
Get an API key from your preferred LLM provider:
| Provider | Platform | API Base |
|---|---|---|
| Anthropic | https://console.anthropic.com | https://api.anthropic.com |
| OpenAI | https://platform.openai.com | https://api.openai.com/v1 |
| DeepSeek | https://platform.deepseek.com | https://api.deepseek.com |
| SiliconFlow | https://siliconflow.cn | https://api.siliconflow.cn/v1 |
Steps:
- Visit the provider's platform to register and login
- Navigate to API Key management
- Create a new key and save it securely
2. Choose Your Usage Mode
Prerequisites: Install uv
Both usage modes require uv. If you don't have it installed:
# macOS/Linux/WSL
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
python -m pip install --user pipx
python -m pipx ensurepath
# Restart PowerShell after installation
# After installation, restart your terminal or run:
source ~/.bashrc # or ~/.zshrc (macOS/Linux)
We offer two usage modes - choose based on your needs:
🚀 Quick Start Mode (Recommended for Beginners)
Perfect for users who want to quickly try Box Agent without cloning the repository or modifying code.
Installation:
# 1. Install directly from GitHub
uv tool install git+https://github.com/Raccoon-Office/Box-Agent.git
# 2. Run interactive setup wizard (creates config and guides you through provider/key setup)
box-agent setup
💡 Tip: If you want to develop locally or modify code, use "Development Mode" below
Configuration:
The setup wizard creates config files in ~/.box-agent/config/. You can review or edit them anytime:
box-agent config # Show current configuration
box-agent config --edit # Open config file in your editor
Fill in your API Key and corresponding API Base:
api_key: "YOUR_API_KEY_HERE"
api_base: "https://api.anthropic.com"
model: "claude-sonnet-4-20250514"
provider: "anthropic"
Start Using:
box-agent # Use current directory as workspace
box-agent --workspace /path/to/your/project # Specify workspace directory
box-agent doctor # Check environment and connectivity
box-agent --version # Check version
# Management commands
uv tool upgrade box-agent # Upgrade to latest version
uv tool uninstall box-agent # Uninstall if needed
uv tool list # View all installed tools
🔧 Development Mode
For developers who need to modify code, add features, or debug.
Installation & Configuration:
# 1. Clone the repository
git clone https://github.com/Raccoon-Office/Box-Agent.git
cd Box-Agent
# 2. Install uv (if you haven't)
# macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell):
irm https://astral.sh/uv/install.ps1 | iex
# Restart terminal after installation
# 3. Sync dependencies
uv sync
# Alternative: Install dependencies manually (if not using uv)
# pip install -r requirements.txt
# Or install required packages:
# pip install tiktoken pyyaml httpx pydantic requests prompt-toolkit mcp
# 4. Initialize Claude Skills (Optional)
git submodule update --init --recursive
# 5. Copy config template
macOS/Linux:
cp box_agent/config/config-example.yaml box_agent/config/config.yaml
Windows:
Copy-Item box_agent\config\config-example.yaml box_agent\config\config.yaml
# 6. Edit config file
vim box_agent/config/config.yaml # Or use your preferred editor
Fill in your API Key and corresponding API Base:
api_key: "YOUR_API_KEY_HERE"
api_base: "https://api.anthropic.com"
model: "claude-sonnet-4-20250514"
provider: "anthropic"
max_steps: 100
workspace_dir: "./workspace"
📖 Full configuration guide: See config-example.yaml
Run Methods:
Choose your preferred run method:
# Method 1: Run as module directly (good for debugging)
uv run python -m box_agent.cli
# Method 2: Install in editable mode (recommended)
uv tool install -e .
# After installation, run from anywhere and code changes take effect immediately
box-agent
box-agent --workspace /path/to/your/project
📖 For more development guidance, see Development Guide
📖 For more production deployment guidance, see Production Guide
ACP & Zed Editor Integration(optional)
Box Agent supports the Agent Communication Protocol (ACP) for integration with code editors like Zed.
Setup in Zed Editor:
- Install Box Agent in development mode or as a tool
- Add to your Zed
settings.json:
{
"agent_servers": {
"box-agent": {
"command": "/path/to/box-agent-acp"
}
}
}
The command path should be:
- If installed via
uv tool install: Use the output ofwhich box-agent-acp - If in development mode:
./box_agent/acp/server.py
Usage:
- Open Zed's agent panel with
Ctrl+Shift+P→ "Agent: Toggle Panel" - Select "box-agent" from the agent dropdown
- Start conversations with Box Agent directly in your editor
Usage Examples
Here are a few examples of what Box Agent can do.
Task Execution
In this demo, the agent is asked to create a simple, beautiful webpage and display it in the browser, showcasing the basic tool-use loop.
Using a Claude Skill (e.g., PDF Generation)
Here, the agent leverages a Claude Skill to create a professional document (like a PDF or DOCX) based on the user's request, demonstrating its advanced capabilities.
Web Search & Summarization (MCP Tool)
This demo shows the agent using its web search tool to find up-to-date information online and summarize it for the user.
Testing
The project includes comprehensive test cases covering unit tests, functional tests, and integration tests.
Quick Run
# Run all tests
pytest tests/ -v
# Run core functionality tests
pytest tests/test_agent.py tests/test_note_tool.py -v
Test Coverage
- ✅ Unit Tests - Tool classes, LLM client
- ✅ Functional Tests - Session Note Tool, MCP loading
- ✅ Integration Tests - Agent end-to-end execution
- ✅ External Services - Git MCP Server loading
Troubleshooting
SSL Certificate Error
If you encounter [SSL: CERTIFICATE_VERIFY_FAILED] error:
Quick fix for testing (modify box_agent/llm.py):
# Line 50: Add verify=False to AsyncClient
async with httpx.AsyncClient(timeout=120.0, verify=False) as client:
Production solution:
# Update certificates
pip install --upgrade certifi
# Or configure system proxy/certificates
Module Not Found Error
Make sure you're running from the project directory:
cd Box-Agent
python -m box_agent.cli
Related Documentation
- Development Guide - Detailed development and configuration guidance
- Production Guide - Best practices for production deployment
Contributing
Issues and Pull Requests are welcome!
- Contributing Guide - How to contribute
- Code of Conduct - Community guidelines
License
This project is licensed under the MIT License.
References
- Anthropic API: https://docs.anthropic.com/claude/reference
- OpenAI API: https://platform.openai.com/docs/api-reference
- Claude Skills: https://github.com/anthropics/skills
- MCP Servers: https://github.com/modelcontextprotocol/servers
⭐ If this project helps you, please give it a Star!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file box_agent-0.1.1.tar.gz.
File metadata
- Download URL: box_agent-0.1.1.tar.gz
- Upload date:
- Size: 3.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8157265e709e4661e19e58a4af8b2f36b8e7067dbfbc48f6c5727b5f228d6719
|
|
| MD5 |
2ee3c3bba14169dc89e5d4aace05e033
|
|
| BLAKE2b-256 |
582f0057968d7d78f8e583cd5c0f07c13e00d1bec137028c432bb0885ee36c8a
|
File details
Details for the file box_agent-0.1.1-py3-none-any.whl.
File metadata
- Download URL: box_agent-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4459cc037a52d525faf3adbf98f6cb507576bf2aad2d0f515e2c7a9b8231445
|
|
| MD5 |
0cc6bf99f3e814e5f44a1936d46e1397
|
|
| BLAKE2b-256 |
5df161f5d86131c6ec0621508676319322ea771534dea6840a5791d22d9a8fec
|