Bamboo Agent π
π A Complete, Self-Contained AI Agent Backend Framework Built with Rust π¦
Bamboo is a production-ready, high-performance AI agent framework that runs entirely locally with zero external dependencies. Built from the ground up in Rust for maximum efficiency and safety, it provides everything you need to build, deploy, and scale AI-powered applications.
π― Why Bamboo?
- β‘ Blazingly Fast - Native Rust performance with zero-cost abstractions
- π Privacy-First - Runs 100% locally, your data never leaves your machine
- π― All-in-One - Complete agent system with built-in HTTP server, no microservices needed
- π¦ Rust-Native - Leverages Rust's safety guarantees and async ecosystem
- π¦ Zero Config - Works out of the box with sensible defaults
- π Production-Ready - Battle-tested with 959+ tests, CORS, rate limiting, security headers
π Full Documentation | π Getting Started | π API Docs
β¨ Key Features
π€ Complete Agent System
- Tool Execution π§ - Execute shell commands, read/write files, search code
- Skill Management π― - Create and manage reusable prompt templates
- Workflow Engine π - Automate complex tasks with YAML-defined workflows
- Todo Tracking β - Built-in task management and progress tracking
- External Memory π§ - Automatic conversation summarization for long sessions
π Built-in HTTP Server
- Actix-web Powered β‘ - High-performance async HTTP server
- REST API π - Complete RESTful API for all operations
- Streaming Support π‘ - Real-time event streaming via Server-Sent Events
- CORS & Security π - Production-ready security headers and CORS configuration
- Rate Limiting π‘οΈ - Built-in protection against abuse
π§ Multi-LLM Provider Support
- OpenAI π¬ - Full support for GPT-4, GPT-3.5, and custom models
- Anthropic π - Claude 3.5 Sonnet, Claude 3 Opus, and more
- Google Gemini β¨ - Gemini 2.0 Flash and Pro models
- GitHub Copilot π¨βπ» - OAuth device flow authentication with token caching
β‘ Performance & Efficiency
- Native Rust π¦ - Zero-cost abstractions, no GC pauses
- Async/Await π - Tokio-based async runtime for maximum concurrency
- Connection Pooling π - Efficient HTTP connection reuse
- Streaming π - Stream large responses without buffering
- Memory Efficient πΎ - Minimal allocations, efficient data structures
ποΈ Architecture
- Modular Design π§© - Clean separation of concerns
- Dual Mode π - Use as standalone binary or embedded library
- XDG-Compliant π - Standard Linux directory layout
- Hot Reload π - Reload configuration without restart
- Plugin System π - MCP (Model Context Protocol) for external tools
π§ͺ Quality & Testing
- 959 Tests β - Comprehensive test coverage with 100% pass rate
- 175 E2E Tests π― - Complete API endpoint coverage (100%)
- 784 Unit Tests π§ͺ - Every module thoroughly tested
- Integration Tests π - End-to-end API testing
- Documentation Tests π - Code examples verified in docs
π Security & Privacy
- Local-First π - Everything runs on your machine
- No Cloud Dependencies βοΈ - Works offline, no API keys stored externally
- Encrypted Storage π - Sensitive data encrypted at rest
- Keyword Masking π - Automatically mask sensitive information
π Installation & Quick Start
π¦ Installation
Option 1: Install from crates.io (Recommended)
Option 2: Build from source
# Clone the repository
# Build in release mode for best performance
# Install locally
π― Quick Start Guide
π₯οΈ Binary Mode (Standalone Server)
# Start server with default settings on port 8080
# Custom configuration
# Enable debug logging
RUST_LOG=debug
π¦ Library Mode (Embedded in Your App)
use ;
async
βοΈ Configuration
Bamboo uses a simple, unified directory structure for all configuration and data.
π Default Paths
All Bamboo data is stored under ~/.bamboo/:
- Config:
~/.bamboo/config.json - Data:
~/.bamboo/(sessions, skills, workflows, etc.) - Cache:
~/.bamboo/cache/ - Runtime:
~/.bamboo/runtime/
You can override the data directory with the BAMBOO_DATA_DIR environment variable.
π Configuration File
Edit ~/.bamboo/config.json (JSON format):
Note: Legacy
config.tomlis no longer loaded. Please migrate toconfig.json.
πͺ Request Hooks (Images)
Some upstream provider paths/models are text-only. Bamboo can optionally:
- preserve images (default):
hooks.image_fallback.enabled=false - rewrite images to placeholder text:
mode="placeholder" - error fast:
mode="error" - OCR:
mode="ocr"(Windows-only; non-Windows currently leaves images intact)
π§ Environment Variables
Override configuration with environment variables (higher priority than config file):
| Variable | Description | Example |
|---|---|---|
BAMBOO_PORT |
Server port | 9000 |
BAMBOO_BIND |
Bind address | 0.0.0.0 |
BAMBOO_DATA_DIR |
Data directory | /var/lib/bamboo |
BAMBOO_PROVIDER |
Default LLM provider | anthropic |
RUST_LOG |
Log level | debug, info, warn |
Migration Guide
Migrating from v0.1.x to v0.2.0
Version 0.2.0 consolidates web_service and agent::server into a unified server module. If you were using the library API:
Before v0.2.0
// NOTE: this legacy import path was removed in v0.2.8.
// use bamboo_agent::agent::server::state::AppState;
use handlers;
use WebService;
use *;
After v0.2.0
use AppState;
use handlers;
use WebService;
use *;
All other code works without changes. The legacy import paths were deprecated in v0.2.0 and removed in v0.2.8.
What Changed
Consolidated Modules:
agent::server::handlersβserver::handlersagent::server::stateβserver::app_stateagent::server::workflowβserver::workflowweb_service::controllersβserver::controllersweb_service::servicesβserver::services
Unified State Management:
- Single
AppStatewith direct provider access (no more proxy pattern) - Consolidated route definitions (eliminated 24 duplicate routes)
- Unified metrics infrastructure
Breaking Changes:
- None (all old import paths still work with deprecation warnings)
Benefits
- β No route duplication: Single source of truth for 100+ routes
- β Direct provider access: No HTTP callbacks to self
- β Clearer architecture: One server module instead of two
- β Better performance: Eliminated proxy pattern
π API Endpoints
Once running, Bamboo exposes a comprehensive REST API:
π₯ Health & Status
# Check server health
π¬ Chat Completions
# OpenAI-compatible chat endpoint
{
}
}
π€ Agent Execution
# Execute agent with tools
{
}
π Workflows
# List all workflows
# Create new workflow
{
}
# Delete workflow
π Sessions
# List all sessions
# Create new session
{
}
π Metrics & Monitoring
# Get usage metrics
# Get session details
π Full API Documentation: See API.md for complete endpoint reference
π οΈ Development
π¨ Build & Run
# Development build (fast compile, slower runtime)
# Release build (slower compile, fastest runtime)
# Run with auto-reload on code changes
# Run tests
# Run tests with coverage
# Check code formatting
# Fix code formatting
# Run linter
π Debugging
# Enable debug logging
RUST_LOG=debug
# Enable trace logging (very verbose)
RUST_LOG=trace
# Run specific test
# Run tests with output
ποΈ Architecture
Bamboo is built with a clean, modular architecture optimized for performance and maintainability:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Bamboo Agent π β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β π HTTP β β π€ Agent β β π§ LLM β β
β β Server β β Loop β β Providers β β
β β β β β β β β
β β - Actix-web β β - Tools β β - OpenAI β β
β β - REST API β β - Skills β β - Anthropic β β
β β - SSE β β - Workflow β β - Gemini β β
β ββββββββββββββββ ββββββββββββββββ β - Copilot β β
β ββββββββββββββββ β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β π Metrics β β πΎ Storage β β π MCP β β
β β β β β β Protocol β β
β β - SQLite β β - JSONL β β β β
β β - Events β β - Sessions β β - Tools β β
β β - Analytics β β - History β β - Servers β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Core Modules
| Module | Description | Key Features |
|---|---|---|
config π |
Configuration management | XDG-compliant, hot-reload, multi-format |
core π― |
Core types and utilities | Encryption, paths, todo tracking |
agent π€ |
Agent system | Loop execution, tools, skills, LLM providers |
server π |
HTTP server & controllers | REST API, streaming, handlers |
process βοΈ |
Process management | Lifecycle tracking, output buffering |
claude π |
Claude Code integration | Binary discovery, version management |
commands π |
Command system | Workflows, slash commands, keyword masking |
Design Principles
- π¦ Zero-Cost Abstractions - Rust's performance guarantees
- β‘ Async-First - Tokio-based async runtime
- π Memory Safe - No data races or buffer overflows
- π¦ Self-Contained - No external runtime dependencies
- π― Single Responsibility - Each module has a clear purpose
π Documentation
| Resource | Description |
|---|---|
| π Full Documentation | Comprehensive guides and tutorials |
| π API Documentation | Auto-generated API docs (docs.rs) |
| π Migration Guide | Upgrading from v0.1.x to v0.2.x |
| π€ Contributing | How to contribute to Bamboo |
| π Changelog | Version history and release notes |
| π Security Policy | Security information and reporting |
π Performance
Bamboo is designed for maximum performance:
- β‘ Startup Time: < 100ms to fully operational
- πΎ Memory Usage: ~10-30MB base, scales with workload
- π Concurrent Requests: 1000+ concurrent connections
- π Throughput: 10,000+ requests/second (depends on workload)
- π Latency: < 10ms for local operations
πΊοΈ Roadmap
Current Version (v0.2.x) β
- Complete agent system
- Multi-LLM provider support
- Workflow automation
- MCP (Model Context Protocol) integration
- Comprehensive metrics & monitoring
Upcoming Features (v0.3.x) π§
- Webhook support for external integrations
- Plugin system for custom tool extensions
- gRPC API for high-performance clients
- WebSocket support for bidirectional streaming
- Built-in web UI dashboard
Future Plans (v1.0+) π
- Kubernetes deployment guides & Helm charts
- Distributed agent execution
- Advanced workflow visualizer
- Multi-tenant support
- Cloud deployment templates
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π€ Contributing
We love contributions! Whether you're fixing bugs, improving documentation, or proposing new features, your help is welcome.
Getting Started:
- Read our Contributing Guidelines
- Check out Good First Issues
- Fork the repo and create a feature branch
- Submit a Pull Request
Code of Conduct: Be respectful, inclusive, and constructive. We're all here to build something great together!
π¬ Support & Community
π Bug Reports
Found a bug? Open an issue
π‘ Feature Requests
Have an idea? Start a discussion
π Security Issues
Found a security vulnerability? Please see SECURITY.md for responsible disclosure.
π¬ Get Help
- GitHub Discussions: Ask questions and share knowledge
- Documentation: Check the full docs first
- Issues: Search existing issues or create a new one
π Star History
If you find Bamboo useful, please consider giving it a β star on GitHub! It helps the project grow and lets others discover it.