Skip to content

aiskillstore/marketplace / skills/2389-research/building-multiagent-systems

building-multiagent-systems

Verified

This skill should be used when designing or implementing systems with multiple AI agents that coordinate to accomplish tasks. Triggers on "multi-agent", "orchestrator", "sub-agent", "coordination", "delegation", "parallel agents", "sequential pipeline", "fan-out", "map-reduce", "spawn agents", "agent hierarchy".

references/maker-pattern.md

View on GitHub
# MAKER Pattern (Million-Agent Voting for Zero Errors)

## Overview

Combines extreme decomposition, microagents, and multi-agent voting to solve tasks requiring 100K+ steps with zero errors. Based on research showing that architectural patterns can overcome LLM error rates through massively decomposed agentic processes (MDAPs).

## Core Components

1. **Extreme Decomposition** - Recursive breakdown until each subtask requires <100 LLM steps
2. **Microagents** - Specialized sub-agents with single tools, focused expertise, cheap models
3. **Multi-Agent Voting** - N parallel attempts per subtask, consensus via majority voting
4. **Error Correction** - Deterministic validation + retry with context from failures

## Implementation

```typescript
// MAKER-style microagent: One tool, one purpose
const parseMicroagent = {
  name: 'parser-microagent',
  model: 'haiku',  // Cheap model for focused task
  tools: [parseASTTool],  // ONLY ONE TOOL
  permissions: ['file:read'],
  timeout: 30000
};

// Voting mechanism (fan-out/fan-in)
async function votingExecution(subtask: string, N: number = 5) {
  // Fan-out: Spawn N identical microagents
  const agents = await Promise.all(
    Array(N).fill(null).map((_, i) =>
      orchestrator.spawnSubAgent({
        ...parseMicroagent,
        name: `parser-vote-${i}`
      })
    )
  );

  // Execute in parallel
  const results = await Promise.all(
    agents.map(agent => agent.run(subtask))
  );

  // Fan-in: Majority vote
  const consensus = majorityVote(results, 0.6);  // 60% threshold

  // Cleanup
  await Promise.all(agents.map(a => a.stop()));

  return consensus;
}

// Extreme decomposition (recursive delegation)
async function solveMillionStepTask(task: ComplexTask, depth: number = 0) {
  // Decompose into subtasks
  const subtasks = await decomposeTask(task);

  if (subtasks.length === 0 || depth > 10) {
    // Base case: Atomic task, use voting
    return await votingExecution(task.description, 5);
  }

  // Recursive case: Solve each subtask
  const results = [];
  for (const subtask of subtasks) {
    const result = await solveMillionStepTask(subtask, depth + 1);

    // Error correction: Validate result
    const isValid = await validateResult(result, subtask.constraints);
    if (!isValid) {
      // Retry with more agents for higher confidence
      result = await votingExecution(
        subtask.description + `\nPrevious failed: ${result}`,
        7  // More agents = lower error rate
      );
    }

    results.push(result);
    await saveCheckpoint({ subtask, result });
  }

  return combineResults(results);
}
```

## When to Use MAKER

- Tasks requiring >100,000 LLM steps
- Zero error tolerance (medical, financial, legal domains)
- Subtasks are independently verifiable with deterministic checks
- Cost is secondary to correctness
- Tasks decompose naturally into hierarchical subtasks

## Trade-offs

| Pros | Cons |
|------|------|
| ✅ Zero errors - Voting exponentially reduces error rates (5 agents with 60% consensus → <0.001% error) | ❌ Cost - N× cost per subtask (5 agents = 5× base cost) |
| ✅ Scalable - Proven to 1M+ steps | ❌ Speed - Slower than single-pass (parallel voting has overhead) |
| ✅ Modular - Each subtask isolated, failures don't cascade | ❌ Complexity - Requires sophisticated orchestration |

## Cost Comparison

```text
Traditional approach:
1000 steps × $0.01 = $10
Error rate: 1% = 10 errors

MAKER approach:
1000 steps ÷ 100 subtasks × 5 voting agents × $0.002 = $10
Error rate: ~0% (voting consensus)

Result: Same cost, zero errors vs. 10 errors
```

## Real-World Example: Medical Diagnosis System

A diagnostic orchestrator processes patient data through 1000+ validation steps with zero error tolerance:

1. **Symptom parsing** (100 microagents voting)
2. **Lab result analysis** (50 microagents voting)
3. **Historical pattern matching** (200 microagents voting)
4. **Differential diagnosis generation** (500 microagents voting)
5. **Treatment recommendation** (150 microagents voting)

Each microagent specializes in one task (e.g., "parse blood pressure reading" or "detect drug interaction"). Voting consensus requires 80% agreement. Deterministic validation checks medical constraints (value ranges, drug interactions, contraindications).

**Architecture:**
```text
Diagnostic Orchestrator (Sonnet, Layer 1-4)
├─→ [Symptom Parsing] 100 microagents vote → consensus
├─→ [Lab Analysis] 50 microagents vote → consensus
├─→ [Pattern Matching] 200 microagents vote → consensus
├─→ [Differential Diagnosis] 500 microagents vote → consensus
└─→ [Treatment Recommendation] 150 microagents vote → consensus

Total: 1000 subtasks × 5 avg voting agents = 5000 agent executions
Error rate: <0.001% (voting + deterministic validation)
Cost: $50 (acceptable for medical domain)
```

## Key Insight

MAKER shows that combining existing patterns (fan-out/fan-in + recursive delegation + deterministic validation) in a specific way achieves unprecedented reliability. The four-layer architecture enables this:
- Layer 1 (reasoning) does decomposition
- Layer 2 (orchestration) spawns voting pools
- Layer 3 (tool bus) validates schemas
- Layer 4 (adapters) provides deterministic validation
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall