{"skill":{"slug":"clawswarm-consensus","displayName":"ClawSwarm","summary":"Multi-agent swarm prediction with consensus engine. Use when: running multiple AI agents to predict prices, values, or outcomes and aggregating their predict...","description":"---\nname: clawswarm\ndescription: \"Multi-agent swarm prediction with consensus engine. Use when: running multiple AI agents to predict prices, values, or outcomes and aggregating their predictions into a consensus. Supports any LLM provider (Groq, OpenAI, Ollama), configurable agent roles/temperatures, and a statistical consensus pipeline (MAD outlier filtering, adaptive anchoring, bias correction, weighted median aggregation). Triggers: swarm prediction, multi-agent consensus, collective intelligence forecasting, price prediction with multiple agents.\"\n---\n\n# ClawSwarm\n\nMulti-agent collective intelligence framework. Run N agents with different analytical perspectives, aggregate predictions through a statistical consensus engine.\n\n## Quick Start\n\n### 1. Create a config file\n\n```yaml\ntarget:\n  name: \"Gold\"\n  current_price: 5023.1\n  unit: \"USD/troy oz\"\n  context: \"RSI: 40.8 | MA5: 5084 | MA10: 5120\"\n\nagents:\n  - role: \"Macro analyst focusing on geopolitical risk\"\n    count: 50\n    temperature_range: [0.4, 0.7]\n  - role: \"Technical RSI/MACD momentum trader\"\n    count: 30\n    temperature_range: [0.45, 0.6]\n  - role: \"Mean reversion auditor\"\n    count: 20\n    temperature_range: [0.35, 0.55]\n\napi:\n  provider: groq\n  model: llama-3.3-70b-versatile\n  api_key_env: GROQ_API_KEY\n  delay_ms: 1200\n\nconsensus:\n  max_deviation: 0.15\n```\n\n### 2. Run the swarm\n\n```bash\npython3 scripts/swarm_runner.py --config swarm.yaml\n```\n\nOutput: JSON with `final_price`, `median_price`, `confidence`, `bull_ratio`, and all individual predictions.\n\n### 3. Run consensus standalone\n\nPipe any predictions array to the consensus engine:\n\n```bash\necho '{\"predictions\":[{\"price\":100.5,\"confidence\":70},{\"price\":99.8,\"confidence\":60}],\"anchor_price\":100.0}' \\\n  | python3 scripts/consensus.py\n```\n\n## Architecture\n\n```\nConfig (YAML/JSON)\n  ↓\nSwarm Runner (swarm_runner.py)\n  ├─ Agent 1 → LLM API → prediction\n  ├─ Agent 2 → LLM API → prediction\n  ├─ ...\n  └─ Agent N → LLM API → prediction\n  ↓\nConsensus Engine (consensus.py)\n  ├─ Bias correction\n  ├─ MAD outlier filtering\n  ├─ Anchor-distance filtering\n  ├─ Multi-method aggregation (weighted 40% + median 35% + trimmed mean 25%)\n  ├─ Adaptive anchoring (dispersion → anchor strength)\n  └─ Clamping\n  ↓\nFinal consensus prediction + confidence + bull/bear ratio\n```\n\n## Key Concepts\n\n**Agent diversity**: Each agent gets a different role prompt and temperature. More diversity = better consensus.\n\n**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.\n\n**1 agent or 1000**: Works with any count. Single agent bypasses consensus. 5+ agents get full pipeline.\n\n## Config Reference\n\nSee `references/config-reference.md` for full field documentation and example configs.\n\n## Scripts\n\n| Script | Purpose |\n|--------|---------|\n| `scripts/swarm_runner.py` | Orchestrate multi-agent predictions |\n| `scripts/consensus.py` | Standalone consensus engine (pipe JSON in) |\n\n## Dependencies\n\n- Python 3.8+\n- `numpy` (for consensus engine)\n- `requests` or `urllib` (for API calls)\n- `pyyaml` (optional, for YAML configs; JSON always works)\n","topics":["Multi Agent","Pipeline"],"tags":{"latest":"0.1.0"},"stats":{"comments":0,"downloads":571,"installsAllTime":21,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1773589213963,"updatedAt":1778491928981},"latestVersion":{"version":"0.1.0","createdAt":1773589213963,"changelog":"Initial release: multi-agent consensus prediction engine with MAD outlier filtering, adaptive anchoring, and configurable swarm orchestration.","license":"MIT-0"},"metadata":null,"owner":{"handle":"alanarchy","userId":"s177nfej6zgfqzzszst1zae3s5885gf4","displayName":"alanarchy","image":"https://avatars.githubusercontent.com/u/21178411?v=4"},"moderation":null}