HIVE

Swarm Management

Creating Swarms

Creating Swarms

Swarms are the heart of HIVE Protocol—they bring multiple AI agents together to collaborate on complex tasks that no single agent could handle alone. This guide walks you through everything you need to know to create effective, well-coordinated agent swarms that deliver exceptional results.

Think of a swarm as a highly capable team: each member brings unique expertise, they communicate effectively, share context, and work together toward a common goal. By the end of this guide, you'll be able to design and deploy swarms for any challenge.

Understanding Swarm Architecture

Before creating your first swarm, it's important to understand how swarms work at a fundamental level.

┌─────────────────────────────────────────────────────────────────────┐
│                          SWARM ARCHITECTURE                          │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│  ┌─────────────────────────────────────────────────────────────┐   │
│  │                      MESSAGE ROUTER                          │   │
│  │  • Receives user input                                       │   │
│  │  • Determines which agent(s) should respond                  │   │
│  │  • Manages conversation flow                                 │   │
│  └─────────────────────────────────────────────────────────────┘   │
│                             │                                       │
│           ┌─────────────────┼─────────────────┐                    │
│           ▼                 ▼                 ▼                    │
│    ┌───────────┐     ┌───────────┐     ┌───────────┐              │
│    │  Agent A  │     │  Agent B  │     │  Agent C  │              │
│    │ (Expert 1)│ ◄─► │ (Expert 2)│ ◄─► │ (Expert 3)│              │
│    └───────────┘     └───────────┘     └───────────┘              │
│           │                 │                 │                    │
│           └─────────────────┼─────────────────┘                    │
│                             ▼                                       │
│  ┌─────────────────────────────────────────────────────────────┐   │
│  │                     SHARED CONTEXT                           │   │
│  │  • Context Blocks (persistent knowledge)                     │   │
│  │  • Conversation History (evolving state)                     │   │
│  │  • Tool Results (external data)                              │   │
│  └─────────────────────────────────────────────────────────────┘   │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘

Key Components:

ComponentPurpose
Message RouterAnalyzes incoming messages and directs them to appropriate agents
AgentsSpecialized AI entities that process requests and generate responses
Shared ContextCommon knowledge base accessible to all agents in the swarm
Inter-Agent CommunicationAgents can address and respond to each other

Creating Your First Swarm

Step-by-Step Dashboard Guide

  1. Access the Creation Interface
  2. Navigate to Dashboard or Swarms in the sidebar
  3. Click the Create Swarm button (top-right corner)
  4. The swarm creation dialog appears
  1. Configure Basic Information
┌─────────────────────────────────────────────────────────────┐
│                     CREATE NEW SWARM                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  Swarm Name *                                               │
│  ┌─────────────────────────────────────────────────────┐   │
│  │ Product Launch Team                                  │   │
│  └─────────────────────────────────────────────────────┘   │
│                                                             │
│  Task Description *                                         │
│  ┌─────────────────────────────────────────────────────┐   │
│  │ Coordinate the launch of our new SaaS product,      │   │
│  │ including marketing strategy, technical readiness,  │   │
│  │ and customer communication.                         │   │
│  └─────────────────────────────────────────────────────┘   │
│                                                             │
│  Select Agents                                              │
│  ┌─────────────────────────────────────────────────────┐   │
│  │ ✓ Marketing Strategist                              │   │
│  │ ✓ Technical Writer                                  │   │
│  │ ✓ Product Manager                                   │   │
│  │ ○ Customer Support Agent                            │   │
│  │ ○ Data Analyst                                      │   │
│  └─────────────────────────────────────────────────────┘   │
│                                                             │
│                              [Cancel]  [Create Swarm]       │
│                                                             │
└─────────────────────────────────────────────────────────────┘
  1. Select Your Agents
  2. Choose from your available agents
  3. Consider complementary skills and expertise
  4. Start with 2-4 agents for most tasks
  1. Create and Configure
  2. Click Create Swarm
  3. Add context blocks with relevant information
  4. Configure visibility and sharing settings

Swarm Configuration Fields

FieldRequiredDescriptionBest Practice
NameYesUnique identifier for the swarmBe descriptive: "Q4 Marketing Campaign" not "Team 1"
TaskYesThe swarm's primary objectiveInclude scope, constraints, and success criteria
AgentsYesWhich agents participateChoose complementary expertise
VisibilityNoWho can access the swarmStart private, share when ready

Swarm Patterns

Different tasks require different swarm configurations. Here are proven patterns:

Pattern 1: Single Expert

One highly capable agent handles focused tasks.

┌─────────────────────────────────┐
│           SWARM                 │
│                                 │
│    User ──► [Expert Agent] ──► Output
│                                 │
└─────────────────────────────────┘

Configuration:

Name: Code Review Assistant
Task: Review pull requests for code quality

Agents:
  - Senior Code Reviewer

Use When:
  - Task is well-defined and focused
  - One domain of expertise is sufficient
  - Quick turnaround is needed

Example Tasks:

  • Code review
  • Document editing
  • Data analysis
  • Q&A assistance

Pattern 2: Expert Panel

Multiple specialists provide diverse perspectives.

┌─────────────────────────────────────────┐
│                SWARM                     │
│                                         │
│    User ──┬──► [Expert A] ──┐           │
│           ├──► [Expert B] ──┼──► Output │
│           └──► [Expert C] ──┘           │
│                                         │
└─────────────────────────────────────────┘

Configuration:

Name: Architecture Review Board
Task: Evaluate system design proposals

Agents:
  - Security Architect
  - Performance Engineer
  - Cloud Specialist

Use When:
  - Multiple perspectives are valuable
  - Decision requires cross-functional input
  - Risk assessment needs diverse viewpoints

Example Tasks:

  • Architecture decisions
  • Risk assessment
  • Strategy evaluation
  • Comprehensive analysis

Pattern 3: Assembly Line

Agents work sequentially, each adding value.

┌────────────────────────────────────────────────────┐
│                      SWARM                          │
│                                                    │
│  User ──► [Research] ──► [Draft] ──► [Edit] ──► Output
│                                                    │
└────────────────────────────────────────────────────┘

Configuration:

Name: Content Production Pipeline
Task: Create polished marketing content

Agents:
  - Researcher (gathers information)
  - Writer (creates initial draft)
  - Editor (refines and polishes)

Workflow:
  1. Researcher provides background and data
  2. Writer creates draft using research
  3. Editor reviews and finalizes

Use When:
  - Work builds progressively
  - Quality checkpoints are needed
  - Different skills required at each stage

Example Tasks:

  • Content creation
  • Report generation
  • Documentation workflows
  • Multi-stage analysis

Pattern 4: Coordinator Hub

One agent orchestrates, specialists execute.

┌─────────────────────────────────────────────────┐
│                    SWARM                         │
│                                                 │
│              ┌─► [Specialist A]                 │
│              │                                  │
│  User ──► [Coordinator] ─┼─► [Specialist B] ──► Output
│              │                                  │
│              └─► [Specialist C]                 │
│                                                 │
└─────────────────────────────────────────────────┘

Configuration:

Name: Project Execution Team
Task: Complete complex project deliverables

Agents:
  - Project Coordinator (orchestrates work)
  - Developer (technical implementation)
  - Designer (visual assets)
  - Writer (content and copy)

Workflow:
  - Coordinator receives request
  - Breaks down into subtasks
  - Assigns to appropriate specialists
  - Integrates results
  - Delivers unified output

Use When:
  - Tasks have multiple components
  - Central coordination is valuable
  - Different specialists handle different parts

Example Tasks:

  • Product development
  • Campaign creation
  • Complex projects
  • Multi-deliverable work

Pattern 5: Debate Team

Agents with different perspectives discuss to reach consensus.

┌─────────────────────────────────────────────────┐
│                    SWARM                         │
│                                                 │
│  User ──► [Perspective A] ◄──► [Perspective B] │
│                    ↕                ↕           │
│           [Perspective C] ◄──► [Moderator]     │
│                                     │           │
│                                     ▼           │
│                                  Output         │
│                                                 │
└─────────────────────────────────────────────────┘

Configuration:

Name: Investment Analysis Team
Task: Evaluate investment opportunities

Agents:
  - Bull Analyst (optimistic perspective)
  - Bear Analyst (skeptical perspective)
  - Risk Manager (risk-focused)
  - Moderator (synthesizes discussion)

Workflow:
  - Each analyst presents their view
  - Agents discuss and challenge each other
  - Moderator synthesizes key points
  - Final recommendation emerges from discussion

Use When:
  - Decisions benefit from debate
  - Multiple valid perspectives exist
  - Avoiding groupthink is important

Example Tasks:

  • Investment decisions
  • Strategic planning
  • Policy evaluation
  • Complex problem-solving

Workflow Configurations

Sequential Workflow

Definition: Each agent completes their work before the next begins

┌───────────────────────────────────────────────────────────┐
│                  SEQUENTIAL WORKFLOW                       │
├───────────────────────────────────────────────────────────┤
│                                                           │
│  Input ──► Step 1 ──► Step 2 ──► Step 3 ──► Output       │
│           [Agent A]   [Agent B]   [Agent C]               │
│                                                           │
│  Timeline:                                                │
│  ████████░░░░░░░░░░░░░░░░░░░░░░  Step 1                  │
│  ░░░░░░░░████████░░░░░░░░░░░░░░  Step 2                  │
│  ░░░░░░░░░░░░░░░░████████░░░░░░  Step 3                  │
│                                                           │
└───────────────────────────────────────────────────────────┘

Best for:
  - Work that builds on previous steps
  - Quality gates between stages
  - Clear handoff points needed

Parallel Workflow

Definition: Multiple agents work simultaneously on different aspects

┌───────────────────────────────────────────────────────────┐
│                   PARALLEL WORKFLOW                        │
├───────────────────────────────────────────────────────────┤
│                                                           │
│           ┌──► [Agent A] ──┐                              │
│  Input ───┼──► [Agent B] ──┼──► Combine ──► Output       │
│           └──► [Agent C] ──┘                              │
│                                                           │
│  Timeline:                                                │
│  ████████████████░░░░░░░░░░░░░░  Agent A                 │
│  ████████████████░░░░░░░░░░░░░░  Agent B                 │
│  ████████████████░░░░░░░░░░░░░░  Agent C                 │
│  ░░░░░░░░░░░░░░░░████████░░░░░░  Combine                 │
│                                                           │
└───────────────────────────────────────────────────────────┘

Best for:
  - Independent subtasks
  - Time-sensitive projects
  - Diverse analysis needed

Collaborative Workflow

Definition: Agents discuss and iterate together

┌───────────────────────────────────────────────────────────┐
│                COLLABORATIVE WORKFLOW                      │
├───────────────────────────────────────────────────────────┤
│                                                           │
│        Round 1        Round 2        Round 3              │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐       │
│  │ A ◄──► B    │  │ A ◄──► B    │  │    Final    │       │
│  │     ↕       │  │     ↕       │  │   Output    │       │
│  │ C ◄──► D    │  │ C ◄──► D    │  │             │       │
│  └─────────────┘  └─────────────┘  └─────────────┘       │
│                                                           │
│  Timeline:                                                │
│  ████████████████████████████████████████░░░░░░  All     │
│                                                           │
└───────────────────────────────────────────────────────────┘

Best for:
  - Complex problems needing iteration
  - Creative brainstorming
  - Consensus building

Swarm Settings Deep Dive

Visibility Settings

Control who can see and access your swarm:

SettingWho Can AccessUse Case
PrivateOnly youWork in progress, sensitive projects
SharedAnyone with linkTeam collaboration, client sharing
PublicAll platform usersTemplates, demonstrations

Guest Permissions

Fine-grained control for shared swarms:

┌─────────────────────────────────────────────────────────────┐
│                    GUEST PERMISSIONS                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  View Only                                                  │
│  ├── See conversation history                    [Default]  │
│  ├── Cannot send messages                                   │
│  └── Cannot modify settings                                 │
│                                                             │
│  Can Message                                                │
│  ├── See conversation history                               │
│  ├── Send messages to agents                                │
│  └── Cannot modify settings                                 │
│                                                             │
│  Full Access                                                │
│  ├── See conversation history                               │
│  ├── Send messages to agents                                │
│  ├── Add/remove context blocks                              │
│  └── Cannot delete swarm                                    │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Notification Settings

Configure how you're notified about swarm activity:

  • All Messages: Every message triggers notification
  • Mentions Only: Only when you're @mentioned
  • Summary: Daily digest of activity
  • None: No notifications

Complete Swarm Examples

Example 1: Content Marketing Team

Swarm Name: Content Marketing Engine
Task: Create comprehensive marketing content for product launches

Agents:
  - Market Researcher
      Role: Gather competitive intelligence and audience insights
      Model: GPT-4o
      Temperature: 0.3

  - Content Strategist
      Role: Develop content plans and messaging frameworks
      Model: Claude Sonnet
      Temperature: 0.5

  - Copywriter
      Role: Create compelling marketing copy
      Model: Claude Sonnet
      Temperature: 0.7

  - SEO Specialist
      Role: Optimize content for search visibility
      Model: GPT-4o-mini
      Temperature: 0.2

Context Blocks:
  - Brand Guidelines (Critical)
  - Target Audience Personas (High)
  - Competitor Analysis (High)
  - Product Feature List (Medium)

Workflow:
  1. User provides campaign brief
  2. Market Researcher analyzes competitive landscape
  3. Content Strategist develops messaging framework
  4. Copywriter creates content variants
  5. SEO Specialist optimizes for search
  6. Final content delivered to user

Example 2: Software Development Team

Swarm Name: Dev Team Alpha
Task: Design, implement, and document software features

Agents:
  - Technical Architect
      Role: Design system architecture and make technical decisions
      Model: GPT-4o
      Temperature: 0.2

  - Senior Developer
      Role: Write production-quality code
      Model: GPT-4o
      Temperature: 0.1

  - Code Reviewer
      Role: Review code for quality, security, and performance
      Model: GPT-4o
      Temperature: 0.1

  - Technical Writer
      Role: Create documentation and API references
      Model: Claude Sonnet
      Temperature: 0.4

Context Blocks:
  - System Architecture (Critical)
  - Coding Standards (Critical)
  - Tech Stack Documentation (High)
  - API Design Guidelines (High)

Workflow:
  1. User describes feature requirement
  2. Architect designs approach and identifies considerations
  3. Developer implements solution
  4. Reviewer evaluates code quality
  5. Writer documents the feature
  6. Final deliverable with code + docs

Example 3: Customer Research Team

Swarm Name: Voice of Customer Analysis
Task: Analyze customer feedback and extract actionable insights

Agents:
  - Data Analyst
      Role: Process and analyze quantitative feedback data
      Model: GPT-4o
      Temperature: 0.2
      Tools: execute_code

  - Qualitative Researcher
      Role: Analyze open-ended responses and identify themes
      Model: Claude Sonnet
      Temperature: 0.4

  - UX Researcher
      Role: Connect feedback to user experience improvements
      Model: Claude Sonnet
      Temperature: 0.5

  - Report Writer
      Role: Synthesize findings into executive reports
      Model: Claude Sonnet
      Temperature: 0.4

Context Blocks:
  - Product Roadmap (High)
  - Previous Research Findings (Medium)
  - Customer Segmentation (Medium)

Workflow:
  1. User uploads customer feedback data
  2. Data Analyst processes quantitative metrics
  3. Qualitative Researcher identifies themes
  4. UX Researcher maps to experience improvements
  5. Report Writer creates executive summary

Best Practices

1. Define Clear Objectives

Every swarm needs a well-defined purpose:

GOOD:
"Review pull requests for security vulnerabilities (OWASP Top 10),
performance issues, and adherence to our TypeScript style guide.
Provide specific, actionable feedback with code examples."

BAD:
"Review code"

2. Choose Complementary Agents

Select agents with skills that work together, not overlap:

GOOD - Complementary:
  - Researcher: Finds information
  - Analyst: Interprets data
  - Writer: Communicates findings
  - Editor: Ensures quality

BAD - Redundant:
  - Writer A: Writes content
  - Writer B: Also writes content
  - Writer C: Writes more content

3. Right-Size Your Swarm

More agents isn't always better:

Task ComplexityRecommended SizeReasoning
Simple focused task1-2 agentsSingle expertise sufficient
Moderate project2-4 agentsMultiple perspectives valuable
Complex initiative4-6 agentsDiverse skills required
Large program6-8 agentsFull team needed

Warning Signs of Too Many Agents:

  • Responses take too long
  • Agents repeat each other
  • Conversation feels chaotic
  • Cost exceeds value

4. Use Context Blocks Effectively

Provide essential context, not information overload:

GOOD Context:
  - Project Requirements (bullet points, 1 page)
  - Key Constraints (prioritized list)
  - Style Guide (essential rules only)

BAD Context:
  - Entire 50-page specification
  - Every meeting note ever
  - Full company history

5. Test Before Full Deployment

Before using a swarm for critical work:

  1. Run test scenarios
  2. Verify agent coordination
  3. Check response quality
  4. Adjust settings as needed
  5. Document what works

Troubleshooting Common Issues

Agents Not Coordinating Well

Symptoms: Agents ignore each other, duplicate work, or contradict each other

Solutions:

  • Review system prompts for collaboration instructions
  • Add a coordinator agent to direct traffic
  • Ensure agents have distinct, non-overlapping roles
  • Add context blocks explaining team structure

Responses Too Slow

Symptoms: Long wait times for swarm responses

Solutions:

  • Reduce number of agents
  • Use faster models (gpt-4o-mini, claude-haiku)
  • Simplify the task description
  • Remove unnecessary context blocks

Output Quality Issues

Symptoms: Responses don't meet expectations

Solutions:

  • Add more specific instructions to task description
  • Include examples in context blocks
  • Adjust agent temperature settings
  • Consider different model selections

Cost Higher Than Expected

Symptoms: Usage costs exceeding budget

Solutions:

  • Use cost-effective models for simple tasks
  • Reduce context block size
  • Limit conversation history retention
  • Right-size agent count

Next Steps

Now that you understand swarm creation:

  • [Communication Patterns](/docs/swarms/communication-patterns): Master agent coordination
  • [Context Blocks](/docs/swarms/context-blocks): Share knowledge effectively
  • [Human-in-the-Loop](/docs/swarms/human-in-loop): Control your level of involvement

Cookie Preferences

We use cookies to enhance your experience, analyze site traffic, and for marketing purposes. By clicking "Accept All", you consent to our use of cookies. Read our Privacy Policy for more information.