Skip to main content
Swarm Type: HeavySwarm

Overview

The HeavySwarm is a sophisticated multi-agent orchestration system inspired by X.AI’s Grok 4 Heavy architecture. It automatically decomposes complex tasks into specialized questions and executes them using five built-in specialized agents: Research, Analysis, Alternatives, Verification, and Synthesis. Unlike other swarm types, HeavySwarm creates and manages its own agents internally — pass an empty agents array ("agents": []) in the request. Key features:
  • Automatic Task Decomposition: Complex tasks are intelligently broken down into specialized questions using function calling
  • Five Specialized Agents: Research, Analysis, Alternatives, Verification, and Synthesis agents work in concert
  • Parallel Execution: Four specialist agents execute simultaneously for maximum efficiency
  • Iterative Refinement: Multi-loop execution where each loop builds upon previous results
  • Comprehensive Synthesis: A dedicated synthesis agent integrates all findings into an executive-ready report

Architecture

The HeavySwarm follows a structured 5-phase workflow:
  1. Task Decomposition — A question generation agent analyzes the input task and creates four specialized questions using function calling
  2. Parallel Execution — Four specialized agents (Research, Analysis, Alternatives, Verification) execute their questions simultaneously
  3. Result Collection — Outputs are validated and collected from all agents
  4. Synthesis — A fifth Synthesis agent integrates all results into a comprehensive report
  5. Iterative Refinement — When heavy_swarm_loops_per_agent > 1, the process repeats with context from previous iterations

Specialized Agents

AgentRole
Research AgentComprehensive information gathering, source verification, data collection, and systematic search strategies
Analysis AgentStatistical analysis, pattern recognition, causal relationship identification, and predictive modeling
Alternatives AgentStrategic option generation, creative problem-solving, scenario planning, and trade-off analysis
Verification AgentFact-checking, feasibility assessment, risk assessment, and compliance verification
Synthesis AgentMulti-perspective integration, executive summaries, strategic alignment, and actionable recommendations

HeavySwarm-Specific Parameters

Since HeavySwarm manages its own agents, it uses dedicated parameters at the swarm configuration level:
ParameterTypeDefaultDescription
heavy_swarm_loops_per_agentinteger1Number of execution loops per agent. Higher values enable iterative refinement for deeper analysis.
heavy_swarm_question_agent_model_namestring"gpt-4.1"Model used for the question generation phase. This agent decomposes the task into specialized questions.
heavy_swarm_worker_model_namestring"claude-sonnet-4-20250514"Model used for all five specialized worker agents (Research, Analysis, Alternatives, Verification, Synthesis).

Use Cases

  • Deep research and comprehensive market analysis
  • Due diligence and investment research
  • Policy analysis and strategic planning
  • Technology assessment and competitive intelligence
  • Complex problem-solving requiring multiple perspectives
  • Medical or scientific research synthesis

API Usage

Basic HeavySwarm Example

curl -X POST "https://api.swarms.world/v1/swarm/completions" \
  -H "x-api-key: $SWARMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Market Research Swarm",
    "description": "Comprehensive market analysis using HeavySwarm",
    "swarm_type": "HeavySwarm",
    "task": "Analyze the current state and future outlook of the renewable energy sector, including market trends, key players, investment opportunities, regulatory landscape, and technological innovations",
    "agents": [],
    "heavy_swarm_loops_per_agent": 1,
    "heavy_swarm_question_agent_model_name": "gpt-4.1",
    "heavy_swarm_worker_model_name": "claude-sonnet-4-20250514",
    "max_loops": 1
  }'

Multi-Loop Deep Analysis Example

Use multiple loops for iterative refinement where each loop builds upon the previous results:
curl -X POST "https://api.swarms.world/v1/swarm/completions" \
  -H "x-api-key: $SWARMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Deep Due Diligence Swarm",
    "description": "Multi-loop investment due diligence analysis",
    "swarm_type": "HeavySwarm",
    "task": "Conduct a comprehensive due diligence analysis on the AI semiconductor industry, evaluating NVIDIA, AMD, and Intel as investment opportunities. Assess financial health, competitive positioning, supply chain risks, and 5-year growth projections",
    "agents": [],
    "heavy_swarm_loops_per_agent": 3,
    "heavy_swarm_question_agent_model_name": "gpt-4.1",
    "heavy_swarm_worker_model_name": "claude-sonnet-4-20250514",
    "max_loops": 2
  }'
Example Response:
{
    "job_id": "swarms-K29xMFDrsmLHxCRoeyF3NVYvPaXk",
    "status": "success",
    "swarm_name": "Market Research Swarm",
    "description": "Comprehensive market analysis using HeavySwarm",
    "swarm_type": "HeavySwarm",
    "output": [
        {
            "role": "Question Generator Agent",
            "content": {
                "research_question": "What are the current global market size, growth rates, and key players across solar, wind, hydrogen, and battery storage segments?",
                "analysis_question": "What statistical patterns emerge from renewable energy adoption rates, cost curves, and capacity factor improvements over the past decade?",
                "alternatives_question": "What are the most promising investment strategies across renewable energy subsectors considering risk-adjusted returns and portfolio diversification?",
                "verification_question": "How do projected renewable energy cost trajectories and policy commitments align with independently verified deployment data and grid integration feasibility?"
            }
        },
        {
            "role": "Research-Agent",
            "content": "Comprehensive research findings on the renewable energy sector including market sizing data, key players analysis, regulatory landscape across major markets, and technological innovation timelines..."
        },
        {
            "role": "Analysis-Agent",
            "content": "Statistical analysis of renewable energy adoption patterns showing compound growth rates, learning curve analysis for solar PV and wind technologies, correlation between policy incentives and deployment rates..."
        },
        {
            "role": "Alternatives-Agent",
            "content": "Strategic investment alternatives analysis covering direct equity positions, ETF-based approaches, project finance opportunities, and emerging technology bets with detailed risk-return profiles..."
        },
        {
            "role": "Verification-Agent",
            "content": "Verification assessment of key claims including cross-referenced deployment data, validated cost projections against IRENA and BloombergNEF databases, feasibility assessment of grid integration targets..."
        },
        {
            "role": "Synthesis-Agent",
            "content": "Executive Summary: The renewable energy sector presents strong investment fundamentals with verified compound growth trajectories. Key Insights: Solar PV costs have declined 89% since 2010, wind energy capacity factors have improved 25%... Actionable Recommendations: 1. Overweight solar and battery storage... Risks & Mitigation: Supply chain concentration in key materials..."
        }
    ],
    "number_of_agents": 5,
    "service_tier": "standard",
    "execution_time": 62.4,
    "usage": {
        "input_tokens": 85,
        "output_tokens": 5400,
        "total_tokens": 5485,
        "billing_info": {
            "cost_breakdown": {
                "agent_cost": 0.08,
                "input_token_cost": 0.000255,
                "output_token_cost": 0.081,
                "token_counts": {
                    "total_input_tokens": 85,
                    "total_output_tokens": 5400,
                    "total_tokens": 5485
                },
                "num_agents": 5,
                "service_tier": "standard",
                "night_time_discount_applied": false
            },
            "total_cost": 0.161255,
            "discount_active": false,
            "discount_type": "none",
            "discount_percentage": 0
        }
    }
}

Best Practices

  • Use HeavySwarm for complex tasks that benefit from multi-perspective analysis rather than simple queries
  • Start with heavy_swarm_loops_per_agent: 1 and increase only when deeper iterative analysis is needed
  • Choose the question agent model carefully — it determines the quality of task decomposition which drives the entire workflow
  • Use a capable worker model (e.g., claude-sonnet-4-20250514) for the specialized agents to get high-quality research, analysis, and verification
  • HeavySwarm requires an empty agents array ("agents": []) in the request — all five agents are created and managed internally
  • For time-sensitive tasks, keep max_loops at 1; increase for comprehensive research where thoroughness is prioritized over speed
  • Schedule non-urgent deep analysis during off-peak hours (8 PM - 6 AM PT) for cost savings