===== Swarming Agents: Parallel Execution Patterns ===== **When and how to use multiple agents in parallel for improved throughput** When One Agent Isnt Enough Single-agent systems have hard limits. Parallel execution through agent swarms can improve throughput but introduces coordination challenges. The Swarming Model A swarm consists of multiple agents working on subtasks simultaneously with an orchestrator coordinator. When to Swarm Good Candidates: * Research on multiple topics simultaneously * Parallel web scraping/verification * Content creation + quality checking in parallel * Multi-source data aggregation Bad Candidates: * Tasks with strict ordering dependencies * Single-threaded operations * Low-complexity tasks (overhead > benefit) Key Challenges Coordination Overhead Each agent adds communication complexity. The orchestrator must distribute work fairly, aggregate results, handle failures, avoid duplicates. Result Merging Outputs combine via sequential (B uses As output), voting (pick best), or pipeline (ABC with overlap). Failure Handling If one agent fails: retry, fail entire swarm, or degrade gracefully. Swarming Patterns Pattern 1: Research Swarm 3 agents search different sources → results merged Good: Comprehensive research Risk: Contradictory information Pattern 2: Quality Swarm 1 agent creates, 2 agents verify → consensus Good: Content quality, fact-checking Risk: Slower but more reliable Pattern 3: Pipeline Swarm ABC with shortcut for speed Good: Sequential but parallelizable tasks Risk: Coordination complexity Trade-offs The Subagent Sweet Spot Connection For most use cases, 2-3 coordinated agents outperforms both single agents and large swarms. Large swarms (5+) have diminishing returns and O(n²) communication complexity. Rule of thumb: Start with 2-3 agents. Scale to swarm only when: 1. Tasks are truly parallelizable 2. Coordination overhead < time savings 3. Result merging is trivial Key Takeaway Swarm only when the task is genuinely parallel. Most tasks are not. **Where it applies:** Agent design decisions **Why it works:** Parallel execution provides throughput gains but coordination complexity can negate benefits **Risks:** Large swarms create more problems than they solve {category>self-improvement}