You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OTbot is a multi-agent system for self-driving laboratories (SDLs). Scientists describe experiments in plain language; OTbot plans, validates, executes, and iterates autonomously — closing the loop between hypothesis and hardware.
Natural language intake — paste a free-text experiment description; the NL parser extracts objective KPIs, parameter spaces, instrument requirements, and round counts
Multi-agent pipeline — 24 specialist agents (planner, safety, simulation, analyzer, compiler, monitor, recovery, …) orchestrated as a campaign
Real-time reasoning stream — every agent step emits SSE events; the browser shows a live decision tree of what each agent considered and why
Hardware agnostic — runs in simulated mode for development; switches to live Opentrons OT-2, PLC relays, and electrochemistry sensors by changing one env var
Adaptive optimization — Bayesian Optimization (Ax), DQN, PPO, genetic algorithms, and multi-objective Pareto search, selected automatically per campaign phase
Safety-first — preflight checks before every round; human-in-the-loop confirmation gates for high-risk operations; full audit trail
Persistent state — SQLite-backed campaign history survives restarts; SSE replays all missed events on reconnect
# 1. Clone
git clone https://github.com/your-org/OTbot.git
cd OTbot
# 2. Configure
cp .env.example .env
# defaults are fine for simulation# 3. Run
docker compose up
# UI: http://localhost:8000/lab# API docs: http://localhost:8000/docs
Live Hardware Mode
# Edit .env
ADAPTER_MODE=live
ROBOT_IP=<your-ot2-ip># Opentrons OT-2 HTTP API
RELAY_PORT=/dev/ttyUSB0 # or 'auto' for auto-detect
SQUIDSTAT_PORT=auto
# Start both services (main + hardware recovery bridge)
docker compose --profile hardware up
Manual Python Setup
# Base (simulated only)
pip install -e .# With hardware drivers
pip install -e ".[hardware]"# With ML strategies (DQN/PPO)
pip install -e ".[ml]"# Full install
pip install -e ".[all]"# Run
ADAPTER_MODE=simulated LLM_PROVIDER=mock \
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
Configuration
All configuration is via environment variables (.env file or shell).
Variable
Default
Description
ADAPTER_MODE
simulated
simulated — no hardware; live — real devices
ADAPTER_DRY_RUN
true
When true, hardware commands are logged but not sent
LLM_PROVIDER
mock
mock (testing), anthropic, or openai
LLM_API_KEY
—
API key for chosen LLM provider
LLM_MODEL
claude-sonnet-4-20250514
Model ID passed to provider
ROBOT_IP
—
OT-2 / OT-2 Flex HTTP API address
RELAY_PORT
auto
Serial port for relay controller
SQUIDSTAT_PORT
auto
Serial port for Squidstat potentiostat
OTBOT_PORT
8000
Main service port
RECOVERY_PORT
8001
Hardware recovery bridge port
DB_PATH
/app/data/orchestrator.db
SQLite database path
API Overview
Base URL: http://localhost:8000
Campaign Lifecycle
Method
Path
Description
POST
/api/v1/orchestrate/start
Start a campaign from a TaskContract
GET
/api/v1/orchestrate/{campaign_id}/status
Query campaign state and progress
GET
/api/v1/orchestrate/{campaign_id}/events/stream
SSE event stream for a campaign
Natural Language Interface
Method
Path
Description
POST
/api/v1/nl/parse
Parse free-text description → TaskContract
Initialization & Onboarding
Method
Path
Description
POST
/api/v1/init/start
Start interactive setup session
POST
/api/v1/init/{session_id}/respond
Respond to initialization prompts
POST
/api/v1/onboarding/start
Onboard a new hardware device
Data & Metrics
Method
Path
Description
GET
/api/v1/campaigns
List all campaigns
GET
/api/v1/runs
List experiment runs
GET
/api/v1/metrics
Campaign KPI metrics
POST
/api/v1/query
Query historical data with DSL
GET
/api/v1/capabilities
Available primitives and templates
Human-in-the-Loop
Method
Path
Description
POST
/api/v1/confirmations/{request_id}/respond
Approve or reject a pending action
POST
/api/v1/evolution/proposals/{proposal_id}/approve
Approve a candidate proposal
Health
Method
Path
Description
GET
/health
Liveness probe (always 200 OK)
GET
/health/ready
Readiness (DB + event bus)
GET
/health/detail
Full diagnostic status
Full interactive docs at http://localhost:8000/docs.
Frontend Lab UI
The primary UI is a single-page app at http://localhost:8000/lab.
All internal communication flows through an async event bus. Key event types:
Event
Trigger
Consumers
CandidateExecuted
Hardware run completes
Metrics, Analyzer, Memory
MetricsUpdated
KPI recomputed
Dashboard, Convergence
ApprovalRequested
Safety gate triggered
UI confirmation dialog
KPIReached
Objective met
Campaign termination
Campaign events are persisted to the campaign_events table so SSE streams replay them on reconnect — the UI receives the full history even if it connects after the campaign has completed.