Skip to main content

Prerequisites

Required: Optional (by sandbox provider):
  • Docker daemon — for the Docker sandbox provider
  • E2B API key — e2b.dev
  • Daytona API key — daytona.io or self-hosted instance
  • AgentBay API key and region access

Installation

1

Clone the repository

git clone https://github.com/OpenDCAI/Mycel.git
cd Mycel
2

Install Python dependencies

# Core dependencies
uv sync

# With specific sandbox providers
uv sync --extra e2b        # E2B
uv sync --extra daytona    # Daytona
uv sync --extra sandbox    # AgentBay
uv sync --extra all        # Everything
Docker works out of the box — just needs Docker installed.
3

Install frontend dependencies

cd frontend/app && npm install && cd ../..

Configuration

User config directory

Mycel stores configuration in ~/.leon/:
~/.leon/
├── config.env          # API keys and base URL
├── runtime.json        # Runtime behavior
├── models.json         # LLM providers and model mapping
├── observation.json    # Tracing (Langfuse / LangSmith)
├── sandboxes/          # Sandbox provider configs
│   ├── docker.json
│   ├── e2b.json
│   └── daytona.json
├── members/            # Agent member bundles
├── skills/             # Skill directories
├── leon.db             # Thread history and agent state
├── chat.db             # Social layer (chats, entities)
└── sandbox.db          # Sandbox session tracking

Quick setup

Create ~/.leon/config.env manually:
ANTHROPIC_API_KEY=sk-ant-xxx
# Or use OpenAI-compatible format:
# OPENAI_API_KEY=your-key
# OPENAI_BASE_URL=https://api.openai.com/v1
# MODEL_NAME=gpt-4o

Starting services

# Terminal 1: backend
uv run python -m backend.web.main
# → http://localhost:8001

# Terminal 2: frontend
cd frontend/app && npm run dev
# → http://localhost:5173
Override the backend port:
PORT=9000 uv run python -m backend.web.main
# or
LEON_BACKEND_PORT=9000 uv run python -m backend.web.main

Sandbox provider setup

See Sandbox for full provider configuration. Quick reference:

Docker

Create ~/.leon/sandboxes/docker.json:
{
  "provider": "docker",
  "on_exit": "pause",
  "docker": {
    "image": "python:3.12-slim",
    "mount_path": "/workspace"
  }
}

E2B

{
  "provider": "e2b",
  "on_exit": "pause",
  "e2b": {
    "api_key": "${E2B_API_KEY}",
    "template": "base",
    "cwd": "/home/user",
    "timeout": 300
  }
}

Daytona (SaaS)

{
  "provider": "daytona",
  "on_exit": "pause",
  "daytona": {
    "api_key": "${DAYTONA_API_KEY}",
    "api_url": "https://app.daytona.io/api",
    "cwd": "/home/daytona"
  }
}

Daytona (self-hosted)

{
  "provider": "daytona",
  "on_exit": "pause",
  "daytona": {
    "api_key": "${DAYTONA_API_KEY}",
    "api_url": "http://localhost:3986/api",
    "target": "us",
    "cwd": "/workspace"
  }
}
Self-hosted requirements:
  1. Runner container image must have bash at /usr/bin/bash
  2. Workspace image must have bash at /usr/bin/bash
  3. Runner must be on both the compose network and the default Docker bridge network
Docker Compose network configuration:
services:
  daytona-runner:
    image: your-runner-image-with-bash
    environment:
      - RUNNER_DOMAIN=runner  # NOT localhost
    networks:
      - default
      - bridge

networks:
  bridge:
    external: true
Add to /etc/hosts on the runner:
127.0.0.1 proxy.localhost
Daytona Proxy (port 4000) must be accessible from the runner for file operations.

AgentBay

{
  "provider": "agentbay",
  "on_exit": "pause",
  "agentbay": {
    "api_key": "${AGENTBAY_API_KEY}",
    "region_id": "ap-southeast-1",
    "context_path": "/home/wuying"
  }
}

Verification

Open the Web UI at http://localhost:5173, register an account, and confirm the agent responds.

Production notes

Database

Mycel uses SQLite by default. For production:
# Backup regularly
cp ~/.leon/leon.db ~/.leon/leon.db.backup
Multi-user deployments may require PostgreSQL — this requires code changes to the storage layer.

Security

  • Store API keys in ~/.leon/config.env, never in code or version control
  • Use ${VAR} substitution in JSON config files instead of hardcoding keys
  • Restrict file permissions: chmod 600 ~/.leon/config.env
  • The block_dangerous_commands setting (default: true) prevents rm -rf and similar shell commands

Proxy environments

If your environment uses an HTTP proxy:
# Prevent proxy from affecting the LLM client or Docker CLI
env -u ALL_PROXY -u all_proxy uv run python -m backend.web.main

Troubleshooting

  • Confirm you’re in the correct directory
  • Confirm the virtual environment is active: source .venv/bin/activate
  • Try using the full path: .venv/bin/python -m backend.web.main
Your shell has all_proxy=socks5://... set. Unset before starting:
env -u ALL_PROXY -u all_proxy uv run python -m backend.web.main
Proxy environment variables inherited by the Docker CLI. Mycel strips these automatically, but if issues persist, check the docker_host config field in ~/.leon/sandboxes/docker.json.
Check each of these in order:
  1. Workspace image has bash at /usr/bin/bash — test with docker run <image> /usr/bin/bash -c "echo ok"
  2. Runner has bash at /usr/bin/bash
  3. Runner is on the Docker bridge network (see Docker Compose config above)
  4. Daytona Proxy (port 4000) is accessible from the runner — test with curl http://proxy.localhost:4000
Common error messages:
  • fork/exec /usr/bin/bash: no such file or directory → workspace image missing bash
  • Failed to create sandbox within 60s → network isolation, check runner networks
  • File operations fail silently → Daytona Proxy unreachable