You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/docs/swarms/cli/cli_heavy_swarm_guide.md

8.9 KiB

CLI Heavy Swarm Guide: Comprehensive Task Analysis

Run Heavy Swarm from command line for complex task decomposition and comprehensive analysis with specialized agents.

Overview

Heavy Swarm follows a structured workflow:

  1. Task Decomposition: Breaks down tasks into specialized questions
  2. Parallel Execution: Executes specialized agents in parallel
  3. Result Synthesis: Integrates and synthesizes results
  4. Comprehensive Reporting: Generates detailed final reports

Basic Usage

Step 1: Run a Simple Analysis

swarms heavy-swarm --task "Analyze the current state of quantum computing"

Step 2: Customize with Options

swarms heavy-swarm \
    --task "Research renewable energy market trends" \
    --loops-per-agent 2 \
    --verbose

Step 3: Use Custom Models

swarms heavy-swarm \
    --task "Analyze cryptocurrency regulation globally" \
    --question-agent-model-name gpt-4 \
    --worker-model-name gpt-4 \
    --loops-per-agent 3 \
    --verbose

Command Options

Option Default Description
--task Required The task to analyze
--loops-per-agent 1 Execution loops per agent
--question-agent-model-name gpt-4o-mini Model for question generation
--worker-model-name gpt-4o-mini Model for worker agents
--random-loops-per-agent False Randomize loops (1-10)
--verbose False Enable detailed output

Specialized Agents

Heavy Swarm includes specialized agents for different aspects:

Agent Role Focus
Question Agent Decomposes tasks Generates targeted questions
Research Agent Gathers information Fast, trustworthy research
Analysis Agent Processes data Statistical analysis, insights
Writing Agent Creates reports Clear, structured documentation

Use Case Examples

Market Research

swarms heavy-swarm \
    --task "Comprehensive market analysis of the electric vehicle industry in North America" \
    --loops-per-agent 3 \
    --question-agent-model-name gpt-4 \
    --worker-model-name gpt-4 \
    --verbose

Technology Assessment

swarms heavy-swarm \
    --task "Evaluate the technical feasibility and ROI of implementing AI-powered customer service automation" \
    --loops-per-agent 2 \
    --verbose

Competitive Analysis

swarms heavy-swarm \
    --task "Analyze competitive landscape for cloud computing services: AWS vs Azure vs Google Cloud" \
    --loops-per-agent 2 \
    --question-agent-model-name gpt-4 \
    --verbose

Investment Research

swarms heavy-swarm \
    --task "Research investment opportunities in AI infrastructure companies for 2024-2025" \
    --loops-per-agent 3 \
    --worker-model-name gpt-4 \
    --verbose

Policy Analysis

swarms heavy-swarm \
    --task "Analyze the impact of proposed AI regulations on tech startups in the United States" \
    --loops-per-agent 2 \
    --verbose

Due Diligence

swarms heavy-swarm \
    --task "Conduct technology due diligence for acquiring a fintech startup focusing on payment processing" \
    --loops-per-agent 3 \
    --question-agent-model-name gpt-4 \
    --worker-model-name gpt-4 \
    --verbose

Workflow Visualization

┌─────────────────────────────────────────────────────────────────┐
│                         User Task                                │
│  "Analyze the impact of AI on healthcare"                       │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                      Question Agent                              │
│  Decomposes task into specialized questions:                     │
│  - What are current AI applications in healthcare?              │
│  - What are the regulatory challenges?                          │
│  - What is the market size and growth?                          │
│  - What are the key players and competitors?                    │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────┬─────────────┬─────────────┬─────────────┐
│  Research   │  Analysis   │  Research   │   Writing   │
│   Agent 1   │   Agent     │   Agent 2   │    Agent    │
└─────────────┴─────────────┴─────────────┴─────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                      Synthesis & Integration                     │
│              Combines all agent outputs                          │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                    Comprehensive Report                          │
│  - Executive Summary                                            │
│  - Detailed Findings                                            │
│  - Analysis & Insights                                          │
│  - Recommendations                                              │
└─────────────────────────────────────────────────────────────────┘

Configuration Recommendations

Quick Analysis (Cost-Effective)

swarms heavy-swarm \
    --task "Quick overview of [topic]" \
    --loops-per-agent 1 \
    --question-agent-model-name gpt-4o-mini \
    --worker-model-name gpt-4o-mini

Standard Research

swarms heavy-swarm \
    --task "Detailed analysis of [topic]" \
    --loops-per-agent 2 \
    --verbose

Deep Dive (Comprehensive)

swarms heavy-swarm \
    --task "Comprehensive research on [topic]" \
    --loops-per-agent 3 \
    --question-agent-model-name gpt-4 \
    --worker-model-name gpt-4 \
    --verbose

Exploratory (Variable Depth)

swarms heavy-swarm \
    --task "Explore [topic] with varying depth" \
    --random-loops-per-agent \
    --verbose

Best Practices

!!! tip "Task Formulation" - Be specific about what you want analyzed - Include scope and constraints - Specify desired output format

!!! tip "Loop Configuration" - Use --loops-per-agent 1 for quick overviews - Use --loops-per-agent 2-3 for detailed analysis - Higher loops = more comprehensive but slower

!!! tip "Model Selection" - Use gpt-4o-mini for cost-effective analysis - Use gpt-4 for complex, nuanced topics - Match model to task complexity

!!! warning "Performance Notes" - Deep analysis (3+ loops) may take several minutes - Higher loops increase API costs - Use --verbose to monitor progress


Comparison: LLM Council vs Heavy Swarm

Feature LLM Council Heavy Swarm
Focus Collaborative decision-making Comprehensive task analysis
Workflow Parallel responses + peer review Task decomposition + parallel research
Best For Questions with multiple viewpoints Complex research and analysis tasks
Output Synthesized consensus Detailed research report
Speed Faster More thorough but slower

Next Steps