在 OpenClaw 中部署生产级多智能体集群,提供经过实战验证的脚本、云部署模板和共享内存基础设施。适用于:(1...
Production deployment focus. This skill provides executable scripts and
cloud-ready configurations — not just documentation. Unlike pure
coordination-pattern skills, this gives you working infrastructure:
agent_setup.py creates your agent directories, routing_config.py
generates OpenClaw config, memory_sync.py wires shared memory,
fleet_validate.py checks your deployment health, and
deploy_script.sh ships to DigitalOcean, AWS, GCP, Azure, or Kubernetes.
Who this is forWhat you getOpenClaw users running 1 agent → need a fleetScripts, templates, working configsDevelopers deploying to cloud (DO/AWS/GCP)Platform YAML/JSON templates + DockerfileTeams needing shared memory across agentsFile-based shared memory with locking + TTLAnyone testing multi-agent architectures5 agent type templates + routing rules
bash
# 1. Create 5 agent directories with SOUL.md + AGENTS.md templates
python scripts/agent_setup.py --agents coordinator,research,builder,auditor,personal --output ./agents
# 2. Generate OpenClaw routing config
python scripts/routing_config.py --input ./agents --output ~/.openclaw/config.json
# 3. Initialize shared memory
python scripts/memory_sync.py --init --path ./shared_memory
# 4. Validate your fleet (new!)
python scripts/fleet_validate.py --agents ./agents --config ~/.openclaw/config.json
# 5. Deploy (or dry-run first)
bash scripts/deploy_script.sh --platform digitalocean --region nyc3 --dry-run
ScriptPurposeKey Featuresscripts/agent_setup.pyScaffold agent directoriesReads templates from assets/templates/, creates 5 agent types + shared dirscripts/routing_config.pyGenerate OpenClaw config.jsonPer-agent routing rules, fallback to coordinator, shared memory wiring, health probes, rate limitsscripts/memory_sync.pyFile-based shared memoryJSON persistence, file-locking, TTL per key, event journaling, agent stats, typed schema validationscripts/fleet_validate.pyValidate deployment healthAgent structure, routing config, shared memory, template integrity checkscripts/deploy_script.shOne-click cloud deployDO App Spec, AWS ECS, GCP Cloud Run, Azure ACI, K8s manifests
FilePurposeassets/templates/SOUL.mdAgent personality + mission template (populated by agent_setup.py)assets/templates/AGENTS.mdOperating rules and protocols template
deployments/digitalocean/app.yaml — DigitalOcean App Platformdeployments/aws/task-definition.json — AWS ECSdeployments/gcp/cloudrun.yaml — GCP Cloud Rundeployments/azure/container-instance.yaml — Azure Container Instancesdeployments/k8s/deployment.yaml — Kubernetes deployment + HPAdeployments/Dockerfile.openclaw — Container image for gateway
(Shipped with skill — customize or regenerate with deploy_script.sh)The skill supports three deployment-tested agent topologies:
text
User → Coordinator → [Research, Builder, Auditor, Personal]
→ Shared Memory ← all
Best for: business workflows, clear task handoffs, teams < 10 agents.
text
Agents ↔ Event Bus ↔ Shared Memory
Best for: creative/research workflows, emergent coordination, high collaboration.
text
Research → Builder → Auditor → Deploy
Best for: content creation, data processing, linear workflows.
See references/architecture.md for full topology diagrams and config examples.
Two backends available — file (default, zero deps) and SQLite (production).
File backend (zero infrastructure):
bash
# Write data (free-form, file backend)
python scripts/memory_sync.py --write 'coordinator:task_status:{"status":"active"}'
# Write data with schema validation
python scripts/memory_sync.py --write 'coordinator:current_task:{"task_id":"t001","assigned_by":"coordinator","assigned_to":"research","priority":"high","title":"Research trends","description":"Analyze marketplace"}' --schema task_assignment
# Read data
python scripts/memory_sync.py --read 'research:search_results'
# View agent stats
python scripts/memory_sync.py --stats
# List available typed schemas
python scripts/memory_sync.py --list-schemas
# List all shared keys (v1.3.0)
python scripts/memory_sync.py --keys
# Count keys per agent (v1.3.0)
python scripts/memory_sync.py --count-by-agent
# Cleanup expired
python scripts/memory_sync.py --cleanup
# === SQLite Backend (production, v1.3.0) ===
# Initialize SQLite shared memory
python scripts/memory_sync.py --backend sqlite --init --path ./shared_memory
# Write with SQLite backend
python scripts/memory_sync.py --backend sqlite --write 'coordinator:task:{"id":"t1"}'
# Migrate from file to SQLite
python scripts/memory_sync.py --migrate-to-sqlite ./shared_memory
# Reclaim SQLite space
python scripts/memory_sync.py --backend sqlite --compact
For high-concurrency production, use the SQLite backend ( --backend sqlite) with WAL mode
for concurrent reads/writes and ACID transactions — all from the Python std library, no pip install needed.
Migrate from file to SQLite:
bash
python scripts/memory_sync.py --migrate-to-sqlite ./shared_memory
Expose shared memory over HTTP using only Python stdlib — no pip install needed.
Start the API server with --listen:
bash
# Start server (default: port 8080, bind 127.0.0.1)
python scripts/memory_sync.py --listen --backend sqlite --path ./shared_memory
MethodPathDescriptionGET/healthHealth checkGET/keys?agent=XList keys (optional agent filter)GET/countKeys per agentGET/statsFull statisticsGET/schemasAvailable typed schemasGET/read/<a>/<k>Read a valuePOST/writeWrite a value (JSON body)bash
# Write via API
curl -X POST http://localhost:8080/write -H "Content-Type: application/json" \
-d '{"agent_id":"coordinator","key":"task:t001","value":{"task_id":"t001","assigned_to":"research"},"schema":"task_assignment"}'
CORS headers included for web-based dashboards.
bash
# Dry-run (generates configs only)
bash scripts/deploy_script.sh --platform aws --region us-east-1 --dry-run
# Actual deploy
bash scripts/deploy_script.sh --platform digitalocean --region nyc3 --size s-2vcpu-2gb
The script:
--platform digitalocean|aws|gcp|azure|k8s)deployments/<platform>/deployments/deployment-summary.mdCustomer → Coordinator → [Support, Inventory, Analytics, Order]
Research → Writer → Editor → Publisher (pipeline pattern)
Planner → Coder → Tester → Deployer → Auditor (pipeline + audit gate)
Coordinator → [Research, Builder, Personal Assistant]
AgentMissionDefault RoutercoordinatorRoute requests, monitor availability, resolve conflictshelp, assist, supportresearchGather and synthesize web informationresearch, find, search, look up, what isbuilderWrite code, create files, debugbuild, create, write, code, script, developauditorReview quality, security, compliancereview, check, audit, validate, testpersonalScheduling, reminders, communicationschedule, remind, calendar, email, message
python scripts/memory_sync.py --statspython scripts/memory_sync.py --backend sqlite --statspython scripts/memory_sync.py --keyspython scripts/memory_sync.py --count-by-agenttail -f shared_memory/events/$(date +%Y%m%d).jsonlopenclaw agents list && openclaw gateway statusLayerProtectionWorkspace isolationEach agent has separate dirsMemory isolationShared memory via API only (file-locked)Tool restrictionsOnly necessary tools per agent typeAudit loggingAll writes logged to event journal
See references/troubleshooting.md for:
DimensionThis SkillPure Coordination SkillsFocusProduction deploymentAgent coordination patternsScripts4 working Python/bash scriptsUsually documentation-onlyCloudMulti-platform (DO/AWS/GCP/Azure/K8s)Rarely includedTemplatesSOUL.md + AGENTS.md (populated at runtime)Often static examplesShared MemoryWorking file-based system with locking, TTL, statsConceptual descriptionTroubleshooting6 failure patterns with executable recovery stepsGeneric advice
This skill's outputs work with OpenClaw 2026.2+ and 2026.3+ features:
sessions_spawn for sub-agent task delegationcron for scheduled multi-agent workflowsfleet_validate.py for post-deployment health checksopenclaw agents management commands for fleet lifecycleThe latest routing config generator ( routing_config.py) automatically generates
configurations for these 2026.3+ features—no manual editing needed:
healthCheck config
with interval, timeout, and retry settingsrateLimit settings
(30 req/min, 5 concurrent)memory_sync.py now supports typed schema
validation via --schema flag. See
references/memory-schemas.md for
all available schemas (task_assignment, status_update, research_finding,
etc.)Agents not responding?
bash
openclaw agents list # Are they running?
journalctl -u openclaw-gateway | tail -20 # Any errors?
Wrong routing?
bash
python scripts/routing_config.py --input ./agents --config-output ./routing-test.json
Shared memory corruption?
bash
python -m json.tool shared_memory/shared_data.json # Validate JSON
python scripts/memory_sync.py --cleanup # Remove expired
python scripts/memory_sync.py --list-schemas # See available typed schemas
Fleet health check?
bash
python scripts/fleet_validate.py --agents ./agents --config ~/.openclaw/config.json
Schema validation on write?
bash
python scripts/memory_sync.py --write 'coordinator:task:{"task_id":"t1","assigned_to":"research"}' --schema task_assignment
VersionDateChanges1.4.02026-05-27HTTP REST API — --listen flag starts zero-dep REST server exposing shared memory over HTTP. GET/POST for read, write, keys, stats, count, cleanup, schemas, health. CORS headers, stdlib only1.3.02026-05-26SQLite backend — WAL-mode concurrent shared memory, ACID transactions, --backend sqlite, --migrate-to-sqlite tool, --keys and --count-by-agent utilities, --compact for space reclamation. No pip deps required. SKILL.md and memory-schemas.md updated with SQLite docs1.2.02026-05-25Structured memory schemas with validation; health probes in routing config; memory-schemas.md reference; rate limiting; --schema and --list-schemas flags; workflows.md with 5 DAG templates; schema validation bug fix (inner data fields + correct schema type); reference list expanded1.1.02026-05-23Fleet validation script added; deployment config templates shipped; date bug fixed; OpenClaw 2026.3+ pattern notes1.0.12026-05-11Templates unified; agent_setup.py reads from assets/templates/; _meta.json + origin tracking added1.0.02026-04-02Initial release — agent setup, routing config, memory sync, cloud deploy
Based on production patterns from Abhi's multi-agent deployment experience. Tested with OpenClaw 2026.2+. Published on ClawHub — slug: multi-agent-deployment