Skip to main content
Swarm Type: RoundRobin

Overview

The RoundRobin swarm implements a collaborative communication pattern where agents take turns processing a task in a true round-robin fashion. Agents are visited in the order you list them in agents, cycling through the full roster once per loop — for N agents and max_loops loops, the schedule is agents[t % N] for each turn t. Every agent reads the full conversation history accumulated by the agents that spoke before it, encouraging them to build upon and refine previous agents’ contributions. This creates a natural collaborative dynamic similar to a brainstorming session. Key features:
  • Deterministic Turn Order: Agents are visited in the exact order you list them, identically on every loop
  • Full Conversation Context: Every agent sees the complete conversation history from prior agents
  • Collaborative Prompting: Built-in turn headers tell each agent who spoke before and after it, encouraging agents to acknowledge and extend others’ contributions
  • Iterative Refinement: Multiple loops allow the group to progressively deepen their analysis, with each agent receiving exactly max_loops turns

Architecture

Agents take turns in the order they appear in agents, each reading the full conversation so far. That same order repeats on every loop.

Use Cases

  • Collaborative brainstorming and ideation sessions
  • Research synthesis from multiple domain experts
  • Code review with multiple engineering perspectives
  • Content creation with iterative editorial refinement
  • Strategic planning with cross-functional input

API Usage

Basic RoundRobin Example

Example Response:

Best Practices

  • Use 3-5 agents for optimal collaboration — too many agents dilute the conversation context
  • Each agent should have a clearly distinct expertise so contributions don’t overlap
  • Increase max_loops when you want agents to iterate and refine each other’s ideas across multiple rounds
  • Agent order is fixed and follows the order you list them in agents, identically on every loop — put the agent that should open the discussion first and the one that should synthesize it last
  • Ideal for tasks where diverse perspectives and iterative refinement produce better results than parallel independent work