Multi Agent Orchestration

    2

    Build production multi-agent systems. 12 patterns, 8 anti-patterns, debugging workflow, cost control. LangGraph + AutoGen + CrewAI.

    Free

    11 usesSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    multi-agent-orchestration

    Example session with this skill installed

    I have a 3-agent research system that keeps looping between the 'web_search' and 'fact_checker' nodes without finishing. Can you detect the issue and suggest a fix?

    • Read your context and instructions
    • Compiled the multi-agent-orchestration

    Detected Anti-Pattern: Loop without exit.
    Reason: No termination condition in 'fact_checker' logic.
    Fix: Applied a max_turns=5 circuit breaker and added a 'Human-in-the-loop' escape hatch.
    Recommended Pattern: Supervisor (to manage state transition).

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Multi-Agent Orchestration

    Multi-agent systems that work in a demo but break in production. This skill is the playbook for building, debugging, and operating them at scale — with patterns that hold up when one agent is slow, one is hallucinating, and your budget is on fire.

    What it does

    A complete reference for production multi-agent systems:

    • 12 proven orchestration patterns (supervisor, peer-to-peer, pipeline, blackboard, marketplace, etc.) with tradeoffs
    • 8 anti-patterns that look fine in a demo but fail in prod (with examples)
    • Reference implementation — TypeScript & Python for the top 3 patterns
    • Debugging workflow — "agents stuck in loop", "agent A won't pass to agent B", "context lost between turns"
    • Cost control — token budgets per agent, circuit breakers, early exit
    • Failure recovery — checkpointing, replay, human-in-the-loop fallback
    • Observability — trace propagation, agent attribution, replay debugging

    When to use it

    • You're building a multi-agent system and don't know which topology to use
    • Your agents loop forever or run out of context
    • Costs are unpredictable — one bad run costs $50
    • You can't tell which agent is the bottleneck
    • You need to add a human-in-the-loop step
    • You're migrating from single-agent to multi-agent

    Why it's better than ad-hoc prompting

    Most "how do I build multi-agent" prompts give toy examples. This skill is different:

    • Production-tested — every pattern is from a real system
    • Quantified — pattern selection has a decision tree, not vibes
    • Reference code — copy-paste starting points in TS & Python
    • Anti-patterns named — know what to avoid before you hit it
    • Debugging workflow — actual steps to fix stuck agents

    Architecture

    ┌─────────────────────────────────────────────────────────┐
    │               Agent (Claude/Cursor)                     │
    │  - Reads user's multi-agent design                      │
    │  - Recommends pattern via decision tree                 │
    │  - Helps implement and debug                            │
    └───────────────┬─────────────────────────────────────────┘
                    │
                    ▼
    ┌─────────────────────────────────────────────────────────┐
    │        skills/multi-agent-orchestration/                │
    │  scripts/                                                │
    │    ├── pattern_suggester.py  # Decision tree            │
    │    ├── topology_diagram.py   # Mermaid generation       │
    │    ├── cost_estimator.py     # Token budget per agent   │
    │    ├── loop_detector.py      # Static analysis          │
    │    └── trace_analyzer.py     # OTLP log parser          │
    │  references/                                             │
    │    ├── patterns.md            # 12 patterns detailed     │
    │    ├── anti-patterns.md       # 8 to avoid               │
    │    ├── decision-tree.md       # Which pattern when       │
    │    └── debugging.md           # Stuck-loop fixes         │
    │  examples/                                               │
    │    ├── supervisor/            # TS + Python reference    │
    │    ├── pipeline/                                           │
    │    └── blackboard/                                         │
    └─────────────────────────────────────────────────────────┘
    

    Quick start

    # 1. Install
    pip install mermaid-py pyyaml tiktoken
    
    # 2. Get pattern recommendation
    python scripts/pattern_suggester.py --requirements requirements.yaml
    
    # 3. Estimate cost
    python scripts/cost_estimator.py --pattern supervisor --agents 3 --turns 10
    
    # 4. Detect loops in your code
    python scripts/loop_detector.py src/agents/
    
    # 5. Analyze traces
    python scripts/trace_analyzer.py traces.jsonl
    

    The 12 patterns (summary)

    #PatternWhen to useCostLatency
    1SupervisorOne clear owner, others are workersMedMed
    2Peer-to-peerAll agents equal, no central authorityHighHigh
    3PipelineSequential processing, each step specializedLowLow
    4BlackboardMultiple specialists share a common stateHighMed
    5MarketplaceAgents bid on tasks, best winsHighHigh
    6HierarchicalTree of supervisors (org chart)MedMed
    7ReflectionAgent critiques its own output, iteratesHighHigh
    8Tool-useOne agent, many tools (not really multi-agent)LowLow
    9DebateTwo agents argue, judge picks winnerVery HighVery High
    10EnsembleN agents solve same task, voteVery HighHigh
    11RouterOne router dispatches to N specialistsLowLow
    12HybridMix of above, e.g. router → supervisorMedMed

    The 8 anti-patterns (with fixes)

    1. Loop without exit — agents call each other with no termination condition → Fix: explicit max turns + circuit breaker

    2. Context stuffing — pass full conversation to every agent → Fix: per-agent context distillation, only relevant slice

    3. Same model, different prompts = "different agents" → Fix: actually use different models or fine-tunes for different roles

    4. Synchronous calls in a loop — each agent blocks the next → Fix: async/await or message queue

    5. No shared state — agents re-derive context every turn → Fix: blackboard pattern with versioned state

    6. Shared mutable state — agents corrupt each other's data → Fix: immutable state + copy-on-write, or actor model

    7. No cost controls — one bad input → 10 agents × 10 turns = $200 → Fix: per-agent token budget + global circuit breaker

    8. No human escape hatch — agents loop forever → Fix: max turns + "ask human" tool + always-available abort

    Reference implementations

    Supervisor (TypeScript)

    import { StateGraph } from "@langchain/langgraph";
    
    const graph = new StateGraph<{ messages: any[]; next: string }>()
      .addNode("supervisor", supervisorNode)
      .addNode("researcher", researcherNode)
      .addNode("writer", writerNode)
      .addEdge("__start__", "supervisor")
      .addConditionalEdges("supervisor", routeNext, {
        researcher: "researcher",
        writer: "writer",
        FINISH: "__end__"
      })
      .addEdge("researcher", "supervisor")
      .addEdge("writer", "supervisor");
    
    export const app = graph.compile();
    

    Pipeline (Python)

    from typing import TypedDict
    from langgraph.graph import StateGraph, START, END
    
    class State(TypedDict):
        raw_input: str
        cleaned: str
        analyzed: dict
        report: str
    
    def clean(s): s["cleaned"] = clean_fn(s["raw_input"]); return s
    def analyze(s): s["analyzed"] = analyze_fn(s["cleaned"]); return s
    def report(s): s["report"] = report_fn(s["analyzed"]); return s
    
    g = StateGraph(State)
    g.add_node("clean", clean)
    g.add_node("analyze", analyze)
    g.add_node("report", report)
    g.add_edge(START, "clean")
    g.add_edge("clean", "analyze")
    g.add_edge("analyze", "report")
    g.add_edge("report", END)
    app = g.compile()
    

    Pricing

    Single-purchase, lifetime access. $16.00.

    Includes:

    • 5 Python scripts (suggestion, cost, detection, tracing, diagrams)
    • 4 reference docs (12 patterns, 8 anti-patterns, decision tree, debugging)
    • 3 reference implementations (supervisor, pipeline, blackboard in TS + Python)
    • Sample trace logs for debugging practice
    • Future updates for the same major version

    Example usage

    "I'm building a research agent that uses 3 sub-agents. They keep looping. Help me fix it and pick the right topology."

    The skill will:

    1. Read your current code
    2. Run the loop detector (likely finds 1-2 of the 8 anti-patterns)
    3. Suggest the right topology (supervisor / pipeline / blackboard)
    4. Estimate cost per run
    5. Output a refactored design with the fix

    Compatibility

    Works with any agent that supports the SKILL.md standard and can execute Python: Claude Code, OpenClaw, Codex CLI, Cursor, Gemini CLI, Cline, Windsurf, Aider. Reference code uses LangGraph but patterns apply to any framework (AutoGen, CrewAI, raw function calling). Tested on Linux, macOS, Windows.

    Tags

    agents, llm, orchestration, langgraph, autogen, crewai, multi-agent, ai-architecture, agent-ops

    • Requires Python for analysis scripts.
    • Architecture code is framework-agnostic but reference examples focus on LangGraph.
    • Does not include pre-hosted infrastructure.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    11 uses

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 4 months ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Listed4 months ago

    What's inside

    Frequently Asked Questions

    This skill provides a structured playbook for moving beyond simple demos to production-ready systems, specifically addressing issues like infinite agent loops, unpredictable token costs, and 'context stuffing' that leads to hallucinations.

    The patterns are framework-agnostic, but the reference code includes ready-to-use implementations in both TypeScript and Python, specifically optimized for LangGraph and similar graph-based architectures.

    Yes, the skill is compatible with popular AI coding tools like Claude Code, Cursor, Windsurf, Aider, and Cline, provided they can execute Python scripts and read Markdown documentation.

    The package includes 5 diagnostic Python scripts (for cost estimation, loop detection, and trace analysis), detailed architecture docs for 12 patterns and 8 anti-patterns, and baseline implementations for the most common topologies.

    The purchase provides lifetime access to the current major version, including any patches and updates to the pattern library or diagnostic scripts as the multi-agent landscape evolves.

    The 'cost_estimator.py' script allows you to input your chosen pattern, agent count, and expected turns to calculate token budgets and set up circuit breakers before you deploy.

    New in Agents & Orchestration

    Free