Files
molecule-core/docs/quickstart.md
T
claude-ceo-assistant f7e2976324
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 9s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 7s
Check migration collisions / Migration version collision check (pull_request) Successful in 10s
CI / Detect changes (pull_request) Successful in 7s
CI / Python Lint & Test (pull_request) Successful in 5s
E2E API Smoke Test / detect-changes (pull_request) Successful in 7s
E2E Chat / detect-changes (pull_request) Successful in 7s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 5s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 10s
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Has been skipped
Handlers Postgres Integration / detect-changes (pull_request) Successful in 6s
Harness Replays / detect-changes (pull_request) Successful in 4s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 4s
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Successful in 33s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Successful in 50s
Lint no tenant GITEA or GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 8s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 9s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 58s
gate-check-v3 / gate-check (pull_request) Successful in 4s
qa-review / approved (pull_request) Successful in 3s
security-review / approved (pull_request) Successful in 3s
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request) Successful in 4s
sop-checklist / review-refire (pull_request) Has been skipped
sop-tier-check / tier-check (pull_request) Successful in 4s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 1m6s
E2E Staging External Runtime / E2E Staging External Runtime (pull_request) Successful in 5m25s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 20s
E2E Chat / E2E Chat (pull_request) Successful in 33s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 11s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 1m58s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2m44s
Harness Replays / Harness Replays (pull_request) Successful in 6s
CI / Platform (Go) (pull_request) Successful in 6m9s
CI / Canvas (Next.js) (pull_request) Successful in 7m41s
CI / all-required (pull_request) Successful in 32m0s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
audit-force-merge / audit (pull_request) Successful in 32s
chore: retire unmaintained workspace runtimes
2026-05-23 23:45:09 -07:00

8.4 KiB

Quickstart Guide

This path is aligned to the current repository and current UI. It gets you from clone to a live workspace on the canvas without assuming any extra platform wrapper.

Prerequisites

  • Docker + Docker Compose v2
  • Node.js 20+
  • Go 1.25+
  • jq (for the template-registry clone in setup.sh)
  • One model/API key for the runtime you want to use
    • ANTHROPIC_API_KEY
    • OPENAI_API_KEY
    • GOOGLE_API_KEY
    • or another provider routed through LiteLLM

The one-command path

git clone https://git.moleculesai.app/molecule-ai/molecule-monorepo.git
cd molecule-monorepo
./scripts/dev-start.sh

That single script:

  1. Generates an ADMIN_TOKEN into .env (first run only — preserved on re-runs)
  2. Brings up Postgres, Redis, Langfuse, ClickHouse, and Temporal via infra/scripts/setup.sh
  3. Populates the workspace template + plugin registry from manifest.json
  4. Builds and starts the platform on http://localhost:8080
  5. Installs canvas deps (first run) and starts the canvas on http://localhost:3000
  6. Prints next-step instructions and tails both processes — Ctrl-C tears everything down

Total wall-clock: ~30 seconds for a re-run, ~2 minutes for a first run (npm install + docker pulls).

Once the canvas is up: open it, add your model API key in Config → Secrets & API Keys → Global, then click a template card or + Create blank workspace.

Manual setup (advanced)

If you'd rather run each component yourself — useful when you're iterating on the platform binary or the canvas in isolation — follow the steps below. Each section is what dev-start.sh does internally; running them by hand gives you per-component logs and lets you keep one piece running while you restart another.

Step 1: Clone the repository

git clone https://git.moleculesai.app/molecule-ai/molecule-monorepo.git
cd molecule-monorepo

Step 2: Start the shared infrastructure

Recommended:

./infra/scripts/setup.sh

That brings up Postgres, Redis, Langfuse, ClickHouse, and Temporal.

If you only want the raw compose flow:

docker compose -f docker-compose.infra.yml up -d

Step 3: Start the platform

cd workspace-server
go run ./cmd/server

The control plane listens on http://localhost:8080.

Step 4: Start the canvas

In a new terminal:

cd canvas
npm install
npm run dev

Open http://localhost:3000.

Step 5: Deploy your first workspace

On a fresh canvas, the center empty state shows template cards plus a blank-workspace option.

You can either:

  1. Click a template to provision a ready-made workspace.
  2. Click + Create blank workspace.

At the same time, the bottom-left onboarding wizard appears and guides the first-run flow.

Step 6: Add an API key

  1. Select the workspace.
  2. Open the Config tab.
  3. Expand Secrets & API Keys.
  4. Add the API key in either:
    • This Workspace
    • Global (All Workspaces)

Global keys are inherited by all workspaces. Workspace keys override globals with the same name.

Step 7: Send the first message

  1. Open the Chat tab.
  2. Send a prompt such as:
What can you help me with in this workspace?

Responses are delivered through the platform A2A proxy and pushed back to the canvas through WebSocket events, with polling kept only as recovery fallback.


Path 2: Remote Agent (run anywhere)

A remote agent runs on your own machine or a cloud VM — no Docker on the platform side. The agent registers with the platform via API, pulls its secrets at boot, and sends heartbeats to stay live on the canvas.

Use this path if you:

  • want to run an agent on your laptop for local development
  • need an agent on a machine with specific hardware (GPU, on-prem)
  • have a data-residency requirement that keeps agent compute off the platform's infra

Step 0: Prerequisites

  • Python 3.10+ and pip install molecule-agent-sdk
  • Outbound HTTPS access from the agent machine to https://<your-org>.moleculesai.app
  • A platform admin token (from the canvas, under Config → Secrets & API Keys → Global)

Step 1: Create the workspace

PLATFORM="https://acme.moleculesai.app"
ADMIN_TOKEN="your-admin-token"

curl -X POST "$PLATFORM/workspaces" \
  -H "Authorization: Bearer $ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-remote-agent",
    "runtime": "external",
    "external": true,
    "url": "https://my-agent.example.com/a2a",
    "parent_id": null
  }'

Save the returned workspace_id.

Step 2: Register the agent

WORKSPACE_ID="ws-xyz"

curl -X POST "$PLATFORM/registry/register" \
  -H "Authorization: Bearer $ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{
    \"workspace_id\": \"$WORKSPACE_ID\",
    \"name\": \"my-remote-agent\",
    \"description\": \"Runs on a cloud VM in us-east-1\",
    \"skills\": [\"research\"],
    \"url\": \"https://my-agent.example.com/a2a\"
  }"

The response includes your bearer token — save it now. It is shown only once.

Step 3: Pull secrets at boot

AGENT_TOKEN="the-token-from-step-2"

curl "$PLATFORM/workspaces/$WORKSPACE_ID/secrets" \
  -H "Authorization: Bearer $AGENT_TOKEN"

Store the returned secrets in your environment before starting the agent.

Step 4: Run the agent

molecule-agent run \
  --workspace-id "$WORKSPACE_ID" \
  --platform-url "$PLATFORM" \
  --agent-token "$AGENT_TOKEN"

The agent connects to the platform, appears on the canvas within ~10 seconds, and starts processing tasks.

Step 5: Configure the agent

Edit config.yaml in the agent's working directory:

name: my-remote-agent
role: researcher
runtime: python
platform_url: https://acme.moleculesai.app
a2a:
  port: 8000

Step 6: Inspect and iterate

The agent appears on the canvas as a workspace card with a REMOTE badge. Open the chat tab, send a task, and watch it work. To iterate, stop and restart the agent — it re-registers with the same workspace_id and token.

Behind NAT (no public IP)

If the agent machine has no public IP, use a tunnel:

# Terminal 1: start a tunnel
ngrok http 8000 --url https://my-agent.ngrok.io

# Update the registered URL
curl -X POST "$PLATFORM/registry/update-card" \
  -H "Authorization: Bearer $AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workspace_id": "'"$WORKSPACE_ID"'", "url": "https://my-agent.ngrok.io/a2a"}'

No inbound firewall rules needed — the agent initiates the outbound WebSocket connection.

Next steps

What To Try Next

  • Expand to a team: right-click a workspace and choose Expand to Team.
  • Switch runtime: use Config -> Runtime to move between Claude Code, Codex, Hermes, and OpenClaw.
  • Inspect operations: check Activity, Traces, Events, and Terminal.
  • Use global keys: configure one provider once in Secrets & API Keys -> Global.
  • Import a template: use the template palette or POST /templates/import.
  • Import/export bundles: duplicate or move workspace trees as .bundle.json.

Troubleshooting

Problem What to check
Workspace stays offline Platform is running, Docker is available, and the runtime has valid credentials
Template palette is empty workspace-configs-templates/ exists and the platform can read it
Chat says agent unavailable Workspace status is not yet online or degraded
No responses from model Add the correct API key in Secrets & API Keys and restart the workspace
Want direct DB access Postgres and Redis are internal-only; use docker compose exec postgres psql or docker compose exec redis redis-cli

Architecture At A Glance

Browser  -->  Canvas (Next.js :3000)
                |
                v
           Platform (Go :8080)
             |       |       |
             |       |       +--> WebSocket events / A2A proxy / templates / bundles
             |       +----------> Redis
             +------------------> Postgres
                                |
                                v
                       Provisioned workspaces
                     (Claude Code / Codex / Hermes / OpenClaw)

For the full system model, see Architecture.