Model-Agnostic Platform for Laboratory Experiments
MAPLE adds LLM agent capabilities to any MADSci-powered laboratory (v0.5.x) via MCP. Two agents — an Operator for experiment execution and an Overseer for lab monitoring — connect to your lab through configurable MCP servers.
pip install maple-mcp
cd your-experiment/
cp .env.example .env # Configure MADSci URLs + model provider
maple serve stub # Start demo (no LLM needed)
maple chat operator # Open TUI — type anything
maple down # Stop all servicesFor a real LLM experiment:
maple serve operator # Start with your configured model
maple chat operator # Run an experiment
maple chat operator --resume # Pick up where you left offSee examples/block_sorting/ for a complete walkthrough.
pip install maple-mcpRequires Python 3.10+ and a running MADSci lab (v0.5.x).
maple serve {all, operator, overseer, stub, mock} [--dev]
maple chat {operator, overseer} [--resume]
maple down
maple status
maple logs
One maple.config.yaml per experiment:
experiment:
name: My Experiment
objective: Sort samples by type
constraints:
- "Only handle one sample at a time"
operator:
vision_backend: "vision:MyVision"
custom_tools:
- "my_tools:prepare_sample"
post_action_hooks:
- node: AnalysisNode
action: verify_placementInfrastructure goes in .env (IPs, API keys, model provider).
| Extension Point | Mechanism | Config Key |
|---|---|---|
| Vision detection | Subclass VisionBackend |
operator.vision_backend |
| MCP tools | @mcp.tool decorator |
operator.custom_tools / overseer.custom_tools |
| Agent hooks | extra_hooks param on factory |
Programmatic |
| Post-action hooks | YAML (no code) | operator.post_action_hooks |
| System prompts | Markdown file | operator.prompt / overseer.prompt |
| Provider | Environment Variable |
|---|---|
| OpenAI | MODEL_PROVIDER=openai |
| Anthropic | MODEL_PROVIDER=anthropic |
| Ollama (local, free) | MODEL_PROVIDER=ollama |
Each device auto-generates a unique identity token. Multiple users can run experiments simultaneously — sessions are isolated automatically.
from maple.operator.agent import create_operator_agent
agent = create_operator_agent("my-session")
result = agent("Sort the colored blocks by color.")pytest -m "not integration" # Unit tests (no network)
docker compose -f docker-compose.ci.yaml up -d # Start MADSci
pytest -m integration # Integration tests- Python 3.10+
- MADSci >=0.5.0, <0.6.0
- FastMCP 3.x