Skip to main content

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.
  • Safety Layer: Dangerous command confirmation, workspace scope control, and automatic file backup before modifications.
  • 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

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:

  1. Visit the provider's platform to register and login
  2. Navigate to API Key management
  3. 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:

  1. Install Box Agent in development mode or as a tool
  2. 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 of which 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

Standalone Runtime (Electron Integration)

Box Agent can be packaged as a standalone binary for embedding in Electron apps or other host processes. The binary bundles Python and all dependencies — no external Python installation required.

Pre-built Downloads

Download platform-specific runtime artifacts from GitHub Releases:

# Download via gh CLI
gh release download v0.4.2 --repo Raccoon-Office/Box-Agent \
  --pattern "box-agent-runtime-*.tar.gz"

Available platforms: darwin-arm64, darwin-x64, linux-x64, linux-arm64

Runtime Structure

box-agent-runtime/
├── manifest.json          # {"name","version","platform","arch","entry","mode"}
├── VERSION                # Plain text version
└── bin/
    ├── box-agent-acp      # Entry binary
    └── _internal/         # Bundled Python + dependencies

Integration Protocol

The runtime binary communicates via ACP JSON-RPC over stdio:

  • stdin: JSON-RPC requests from host process
  • stdout: JSON-RPC responses only (zero diagnostic output)
  • stderr: All logs, diagnostics, tool loading status

Environment variables for debug logging:

  • BOX_AGENT_LOG_LEVEL: DEBUG | INFO | WARN | ERROR (default: INFO)
  • BOX_AGENT_LOG_FILE: Path to log file (in addition to stderr)
  • BOX_AGENT_LOG_FORMAT: text | json (default: text)

Build from Source

# Install build dependencies
uv sync --group dev

# Build for current platform (reads version from __version__)
uv run python scripts/build_runtime.py

# Output: dist/runtime/box-agent-runtime-v{version}-{platform}-{arch}.tar.gz

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.

Demo GIF 1: Basic Task Execution

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.

Demo GIF 2: Claude Skill Usage

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.

Demo GIF 3: Web Search

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

Contributing

Issues and Pull Requests are welcome!

License

This project is licensed under the MIT License.

References


⭐ 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

box_agent-0.4.4.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

box_agent-0.4.4-py3-none-any.whl (3.5 MB view details)

Uploaded Python 3

File details

Details for the file box_agent-0.4.4.tar.gz.

File metadata

  • Download URL: box_agent-0.4.4.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

Hashes for box_agent-0.4.4.tar.gz
Algorithm Hash digest
SHA256 c17a99769ae0ffedc7203f697bee07177a80cb7023fbc9a0f766fc6ee667e630
MD5 6a222a5a4a3b29c7da6ce1a6939e3c83
BLAKE2b-256 cc0d75d1e2e3a5516055937efce08a574e48a031af33ce7c3daee2ca61633e18

See more details on using hashes here.

File details

Details for the file box_agent-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: box_agent-0.4.4-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

Hashes for box_agent-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 18fcf4eeacee47bc58fd5f41082bce59d5f111a2dcda101dcca5f55b92a3a9a7
MD5 7de25cc8a9a136be89f3010896463c27
BLAKE2b-256 00cb5f1d0ee2507291e91548b7c040477763d3ef16e9233b6e80fa9b76b776c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page