Skip to main content

Software Development Team with Hierarchical Coordination

This example demonstrates how to build a development team where a tech lead coordinates specialized engineers - perfect for complex projects requiring oversight and synthesis.

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 Your Hierarchical Team

Create a development team of 5 specialist agents. HierarchicalSwarm supplies its own director agent to coordinate them, so every agent you list is a worker:

Step 4: Run the Team

Expected Output:
HierarchicalSwarm creates its own director agent (model set by director_model_name, default gpt-5.4) that plans the work, assigns it to the agents you supply, and synthesizes their outputs. Every agent in agents is a worker.

Step 5: Customize the Director

Pass director_model_name to change which model runs the director, and director_settings for director-specific hyperparameters (temperature, top_p, max_tokens, etc.):
director_model_name and director_settings are SwarmSpec fields, not AgentSpec fields - set them alongside swarm_type and agents, not inside any agent object.