π Bug Investigator - Multi-Agent Debugging System
A production-ready multi-agent system built with Docker cagent that helps developers debug and fix code issues.
π― What You'll Learn
- Build a multi-agent system with specialized roles
- Integrate MCP tools (search, filesystem)
- Push agents to Docker Hub
- Deploy to DigitalOcean for 24/7 availability
ποΈ Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BUG INVESTIGATOR β
β (Root Coordinator) β
β β
β β’ Analyzes errors & stack traces β
β β’ Coordinates the debugging workflow β
β β’ Provides final diagnosis β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
βΌ βΌ βΌ
βββββββββββββββββ βββββββββββββ βββββββββββββ
β RESEARCHER β β FIXER β β TESTER β
β β β β β β
β β’ Web search β β β’ Write β β β’ Validateβ
β β’ Find docs β β fixes β β β’ Test β
β β’ Solutions β β β’ Code β β cases β
βββββββββββββββββ βββββββββββββ βββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββ βββββββββββββ βββββββββββ
β DuckDuckGoβ β Filesystemβ β Think β
β MCP β β Tools β β Tool β
βββββββββββββ βββββββββββββ βββββββββββ
π Quick Start
Prerequisites
- Docker Desktop 4.49+ (includes cagent)
- API key:
ANTHROPIC_API_KEYorOPENAI_API_KEY
Step 1: Clone and Run Locally
Clone the repo
git clone https://github.com/ajeetraina/bug-investigator
cd bug-investigator/
Set your API key
export ANTHROPIC_API_KEY=your_key_here
# OR
export OPENAI_API_KEY=your_key_here
Run the agent (if using OpenAI)
cagent run ./cagent-openai.yaml "Read app.py and find all bugs"
π¦ Deploy to Production
Push to Docker Hub
# Login to Docker Hub
docker login
# Push your agent
cagent push ./cagent.yaml docker.io/YOUR_USERNAME/bug-investigator:latest
# Verify it's there
cagent pull docker.io/YOUR_USERNAME/bug-investigator:latest
Deploy to DigitalOcean
Option 1: One-Click Marketplace
- Go to DigitalOcean Marketplace - cagent
- Click "Create cagent Droplet"
- Choose size:
s-2vcpu-4gb(recommended) - SSH into your droplet and run your agent
Option 2: API Deployment
# Set your DigitalOcean token
export DO_TOKEN=your_digitalocean_token
# Create droplet with cagent pre-installed
curl -X POST -H 'Content-Type: application/json' \
-H "Authorization: Bearer $DO_TOKEN" \
-d '{
"name": "bug-investigator-prod",
"region": "sfo2",
"size": "s-2vcpu-4gb",
"image": "cagent"
}' \
"https://api.digitalocean.com/v2/droplets"
Run in Production
# SSH into your droplet
ssh root@YOUR_DROPLET_IP
# Set API keys
export ANTHROPIC_API_KEY=your_key
# Pull and run your agent
cagent run docker.io/YOUR_USERNAME/bug-investigator:latest
π§ͺ Example Bugs to Try
Python: NoneType Error
TypeError: 'NoneType' object is not subscriptable
JavaScript: Async/Await Issue
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
Go: Nil Pointer
panic: runtime error: invalid memory address or nil pointer dereference
Docker: Build Failure
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref
Kubernetes: CrashLoopBackOff
kubectl logs my-pod
Error: EACCES: permission denied, open '/app/data/config.json'
π§ Customization
Add GitHub Integration
# Add to researcher agent toolsets
toolsets:
- type: mcp
ref: docker:github
Add Slack Notifications
# Add to root agent toolsets
toolsets:
- type: mcp
ref: docker:slack
Use Local Models (No API Key)
models:
local:
provider: dmr
model: ai/gemma3:2B-Q4_0
max_tokens: 4096
agents:
root:
model: local
# ... rest of config
π Workshop Flow
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DEVELOPMENT TO PRODUCTION β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β 1. LOCAL DEV 2. PACKAGE 3. PRODUCTION β
β βββββββββββ βββββββββ ββββββββββββ β
β β
β ββββββββββββ ββββββββββββ ββββββββββββββββ β
β β Create β β Push to β β DigitalOcean β β
β β Agent βββββββββΆβ Docker βββββββββΆβ Droplet β β
β β YAML β β Hub β β (1-Click) β β
β ββββββββββββ ββββββββββββ ββββββββββββββββ β
β β β β β
β βΌ βΌ βΌ β
β cagent run cagent push cagent run β
β ./cagent.yaml ./cagent.yaml user/agent:tag β
β user/agent:tag β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Key Concepts Covered
| Concept | Description |
|---|---|
| Multi-Agent | Specialized agents collaborating on complex tasks |
| MCP Tools | External capabilities via Model Context Protocol |
| Agent Delegation | Root agent routing tasks to specialists |
| OCI Artifacts | Packaging agents like container images |
| Production Deploy | Running agents 24/7 on cloud infrastructure |