← 返回
AI智能 Key 中文

Mixture of Agents

Mixture of Agents: Make 3 frontier models argue, then synthesize their best insights into one superior answer. ~$0.03/query.
混合智能体:让3个前沿模型进行辩论,然后综合它们各自的最佳见解,形成更优质的回答。约$0.03/查询。
jscianna
AI智能 clawhub v1.2.0 1 版本 99908.7 Key: 需要
★ 0
Stars
📥 1,094
下载
💾 14
安装
1
版本
#latest

概述

Mixture of Agents (MoA)

TL;DR: Make 3 AI models argue with each other. Get an answer better than any single model. Cost: ~$0.03.

Two Usage Modes

A. Standalone CLI (Node.js)

export OPENROUTER_API_KEY="your-key"
node scripts/moa.js "Your complex question"

B. OpenClaw Skill (Agent-orchestrated)

# Install
clawhub install moa

# Or copy to ~/clawd/skills/moa/

The agent can then invoke MoA for complex analysis tasks.


Origin Story

The concept of "Mixture of Agents" comes from research showing LLMs can improve each other's outputs through collaboration. I built this for VC deal analysis—when evaluating startups, you want multiple perspectives, not one model's opinion.

The journey:

  1. Started with 5 free OpenRouter models (Llama, Gemini, Mistral, Qwen, Nemotron)
  2. Rate limits killed me at 2am during peak hours
  3. Switched to 3 paid frontier specialists
  4. Result: ~$0.03/query, answers better than any single model

When to Use

  • Complex analysis — due diligence, market research, technical evaluation
  • Brainstorming — get diverse ideas, synthesize the best
  • Fact-checking — cross-reference across models with different training data
  • High-stakes decisions — when one model's blind spots could hurt you
  • Contrarian thinking — different models have different biases

When NOT to use:

  • Quick Q&A (too slow, 30-90s latency)
  • Real-time chat (not designed for streaming)
  • Simple lookups (overkill)

Model Configuration

Paid Tier (Default) — Recommended

RoleModel~LatencyStrength
---------------------------------
Proposer 1moonshotai/kimi-k2.523sLong context, strong reasoning
Proposer 2z-ai/glm-536sTechnical depth, different training corpus
Proposer 3minimax/minimax-m2.564sNuance catching, thorough analysis
Aggregatormoonshotai/kimi-k2.515sFast synthesis

Why these models?

  • Frontier-class but less congested than GPT-4/Claude
  • Different training data = genuinely different perspectives
  • Chinese models excel at certain reasoning tasks
  • Combined cost still cheaper than single Opus call

Cost breakdown:

3 proposers × ~$0.008 = $0.024
1 aggregator × ~$0.005 = $0.005
─────────────────────────────
Total: ~$0.029/query

Free Tier (Fallback)

5 models: Llama 3.3 70B, Gemini 2.0 Flash, Mistral Small, Nemotron 70B, Qwen 2.5 72B

⚠️ Warning: Free tier hits rate limits during peak hours. Use --free flag only for testing.


How It Works

        ┌─────────────┐
        │   PROMPT    │
        └──────┬──────┘
               │
    ┌──────────┼──────────┐
    ▼          ▼          ▼
┌────────┐ ┌────────┐ ┌────────┐
│Kimi 2.5│ │ GLM 5  │ │MiniMax │  ← Parallel (they "argue")
│(reason)│ │(depth) │ │(nuance)│
└───┬────┘ └───┬────┘ └───┬────┘
    │          │          │
    └──────────┼──────────┘
               ▼
       ┌──────────────┐
       │  AGGREGATOR  │
       │  (Kimi 2.5)  │
       │              │
       │ • Best of 3  │
       │ • Resolve    │
       │   conflicts  │
       │ • Synthesize │
       └──────┬───────┘
              ▼
       ┌──────────────┐
       │ FINAL ANSWER │
       │ (Synthesized)│
       └──────────────┘

API Reference

Function Signature

interface MoAOptions {
  prompt: string;           // Required: The question to analyze
  tier?: 'paid' | 'free';   // Default: 'paid'
}

interface MoAResult {
  synthesis: string;        // The final aggregated answer
}

// Throws on complete failure (all models down, invalid key)
// Returns partial synthesis if 1-2 models fail
async function handle(options: MoAOptions): Promise<string>

CLI Usage

# Paid tier (default)
node scripts/moa.js "Your complex question"

# Free tier
node scripts/moa.js "Your question" --free

Programmatic Usage

const { handle } = require('./scripts/moa.js');

const synthesis = await handle({ 
  prompt: "Analyze the competitive moats in AI code generation",
  tier: 'paid'
});

console.log(synthesis);

Failure Modes

ScenarioBehavior
--------------------
1 proposer failsSynthesis from remaining 2 models
2 proposers failSynthesis from 1 model (degraded)
All proposers failReturns error message
Invalid API keyImmediate error with setup instructions
Rate limit (free tier)Returns rate limit error

The system is designed to degrade gracefully. A 2/3 response is still valuable.


Example Use Cases

VC Due Diligence

node scripts/moa.js "Analyze the competitive landscape for AI code generation. \
Who has defensible moats? Who's likely to be commoditized? Be specific."

Technical Evaluation

node scripts/moa.js "Compare RLHF vs DPO vs RLAIF for LLM alignment. \
Which scales better? What are the failure modes of each?"

Market Research

node scripts/moa.js "What are the emerging use cases for embodied AI in 2026? \
Focus on robotics, drones, and autonomous systems. Include specific companies."

Performance Expectations

MetricPaid TierFree Tier
------------------------------
P50 Latency~45s~60s
P95 Latency~90s~120s+
Success Rate>99%~80% (rate limits)
Cost/Query~$0.03$0.00

Tips

  1. Be specific — Vague prompts get vague synthesis
  2. Ask for structure — "Give me pros/cons" or "List top 5" helps the aggregator
  3. Use for analysis, not chat — MoA shines for complex reasoning
  4. Batch your queries — 30-90s per query, so plan accordingly

Installation

Via ClawHub (Recommended)

clawhub install moa

Manual

  1. Copy skills/moa/ to your ~/clawd/skills/ directory
  2. Set OPENROUTER_API_KEY in your environment
  3. The agent can now invoke MoA for complex queries

Environment Variables

VariableRequiredDescription
---------------------------------
OPENROUTER_API_KEYYesYour OpenRouter API key

Get your key at: https://openrouter.ai/keys


Credits

版本历史

共 1 个版本

  • v1.2.0 当前
    2026-03-29 10:28 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 839 📥 213,470
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,363 📥 319,028
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 714 📥 244,131