/install clawswarm-consensus
ClawSwarm
Multi-agent collective intelligence framework. Run N agents with different analytical perspectives, aggregate predictions through a statistical consensus engine.
Quick Start
1. Create a config file
target:
name: "Gold"
current_price: 5023.1
unit: "USD/troy oz"
context: "RSI: 40.8 | MA5: 5084 | MA10: 5120"
agents:
- role: "Macro analyst focusing on geopolitical risk"
count: 50
temperature_range: [0.4, 0.7]
- role: "Technical RSI/MACD momentum trader"
count: 30
temperature_range: [0.45, 0.6]
- role: "Mean reversion auditor"
count: 20
temperature_range: [0.35, 0.55]
api:
provider: groq
model: llama-3.3-70b-versatile
api_key_env: GROQ_API_KEY
delay_ms: 1200
consensus:
max_deviation: 0.15
2. Run the swarm
python3 scripts/swarm_runner.py --config swarm.yaml
Output: JSON with final_price, median_price, confidence, bull_ratio, and all individual predictions.
3. Run consensus standalone
Pipe any predictions array to the consensus engine:
echo '{"predictions":[{"price":100.5,"confidence":70},{"price":99.8,"confidence":60}],"anchor_price":100.0}' \
| python3 scripts/consensus.py
Architecture
Config (YAML/JSON)
↓
Swarm Runner (swarm_runner.py)
├─ Agent 1 → LLM API → prediction
├─ Agent 2 → LLM API → prediction
├─ ...
└─ Agent N → LLM API → prediction
↓
Consensus Engine (consensus.py)
├─ Bias correction
├─ MAD outlier filtering
├─ Anchor-distance filtering
├─ Multi-method aggregation (weighted 40% + median 35% + trimmed mean 25%)
├─ Adaptive anchoring (dispersion → anchor strength)
└─ Clamping
↓
Final consensus prediction + confidence + bull/bear ratio
Key Concepts
Agent diversity: Each agent gets a different role prompt and temperature. More diversity = better consensus.
Consensus engine: Not a simple average. Uses MAD (Median Absolute Deviation) to filter outliers, adaptive anchoring to stabilize results when predictions are dispersed, and multi-method aggregation for robustness.
1 agent or 1000: Works with any count. Single agent bypasses consensus. 5+ agents get full pipeline.
Config Reference
See references/config-reference.md for full field documentation and example configs.
Scripts
| Script | Purpose |
|---|---|
scripts/swarm_runner.py |
Orchestrate multi-agent predictions |
scripts/consensus.py |
Standalone consensus engine (pipe JSON in) |
Dependencies
- Python 3.8+
numpy(for consensus engine)requestsorurllib(for API calls)pyyaml(optional, for YAML configs; JSON always works)
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install clawswarm-consensus - 安装完成后,直接呼叫该 Skill 的名称或使用
/clawswarm-consensus触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
ClawSwarm 是什么?
Multi-agent swarm prediction with consensus engine. Use when: running multiple AI agents to predict prices, values, or outcomes and aggregating their predict... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 218 次。
如何安装 ClawSwarm?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install clawswarm-consensus」即可一键安装,无需额外配置。
ClawSwarm 是免费的吗?
是的,ClawSwarm 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
ClawSwarm 支持哪些平台?
ClawSwarm 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 ClawSwarm?
由 alanarchy(@alanarchy)开发并维护,当前版本 v0.1.0。