multi-agent-patterns

Design multi-agent systems with supervisor, swarm, and hierarchical coordination patterns.

Updated Aug 7, 2026
One-click install
npx skills add https://github.com/Sambhav242005/Major-Project --skill multi-agent-patterns-sambhav242005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: multi-agent-patterns
Source: https://github.com/Sambhav242005/Major-Project/tree/main/.agents/skills/multi-agent-patterns
Command: npx skills add https://github.com/Sambhav242005/Major-Project --skill multi-agent-patterns-sambhav242005

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Single-agent systems hit context window limits, degrade through accumulated noise, and cannot parallelize work across independent subtasks. This Skill provides architectural patterns and reusable coordination code for distributing work across multiple LLM agents without losing control or blowing up token budgets. ## Core Features & Use Cases - Architecture Selection: Guidance for choosing between supervisor/orchestrator, peer-to-peer swarm, and hierarchical patterns based on coordination needs rather than organizational metaphor. - Coordination Building Blocks: A Python module with message buses, supervisor task decomposition, handoff protocols, weighted consensus voting, and circuit-breaker failure handling. - Framework References: Implementation examples for LangGraph, AutoGen, and CrewAI covering supervisors, swarms, context isolation, and debate protocols. - Use Case: When building a research pipeline where a coordinator delegates search, analysis, fact-checking, and writing to specialized agents, use this Skill to structure handoffs, prevent error propagation, and budget for the roughly 15x token cost of multi-agent runs. ## Quick Start Ask the AI to design a multi-agent architecture for your task using the supervisor or swarm pattern and generate the coordination scaffolding from the included Python utilities.

Frequently Asked Questions about multi-agent-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between supervisor and swarm multi-agent patterns?

Choose a supervisor when tasks have clear decomposition and human oversight matters; choose a swarm when requirements emerge dynamically and rigid planning is counterproductive. Supervisors centralize control but risk bottlenecks, while swarms eliminate single points of failure at the cost of harder convergence.

How do I implement agent handoffs in LangGraph?

Implement handoffs by having agent nodes return a next_agent field in the graph state and wiring edges between agent nodes in a StateGraph. The references file shows a full swarm example with triage, research, analysis, and writing agents transferring control through explicit handoff edges.

When should I use multiple agents instead of one agent?

Use multiple agents when a single context window cannot hold all task-relevant information, when subtasks run in parallel, or when subtasks need different tools and system prompts. If a single agent with a longer context suffices, multi-agent coordination overhead is not justified.

Why do multi-agent systems cost so many tokens?

Multi-agent runs cost roughly 15x a single-agent baseline because of coordination messages, retries, and consensus rounds on top of per-agent work. Budget for this multiplier and measure against a single-agent baseline before assuming extra agents help.

How do I prevent errors from cascading between agents?

Validate each agent's output before passing it downstream, add retry logic with circuit breakers, and consider a verification agent for critical outputs. The included AgentFailureHandler class implements exponential backoff retries and automatic rerouting after repeated failures.

What are the limitations of majority voting for agent consensus?

Simple majority voting treats hallucinations from weak agents as equal to strong reasoning and encourages sycophantic agreement. Use confidence-weighted voting or structured debate protocols with explicit adversarial roles instead.