Skip to main content

Comprehensive Market Intelligence with HeavySwarm

This example demonstrates how to use HeavySwarm for deep, multi-perspective analysis. Unlike other swarm types, HeavySwarm automatically creates and manages five specialized agents (Research, Analysis, Alternatives, Verification, Synthesis) — you provide the task, configuration, and an empty agents array.

Step 1: Get Your API Key

  1. Visit https://swarms.world/platform/api-keys
  2. Sign in or create an account
  3. Generate a new API key
  4. Set it as an environment variable:

Step 2: Setup

Step 3: Define the Research Function

HeavySwarm creates its own five specialized agents internally — pass an empty agents array and configure the swarm using HeavySwarm-specific parameters:

Step 4: Run the Analysis

Expected Output:

Step 5: Multi-Loop Deep Dive (Optional)

For tasks requiring deeper analysis, increase heavy_swarm_max_loops and max_loops. Each iteration builds on previous results:
HeavySwarm is best suited for complex research and analysis tasks that benefit from multiple specialized perspectives. It automatically decomposes your task into four targeted questions, executes them in parallel across Research, Analysis, Alternatives, and Verification agents, then synthesizes everything into a comprehensive report. No agent configuration is needed — just provide the task and an empty agents array.