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 randomized round-robin fashion. Each loop, agents are shuffled into a random order and each receives the full conversation history, encouraging them to build upon and refine previous agents’ contributions. This creates a natural collaborative dynamic similar to a brainstorming session. Key features:
  • Randomized Turn Order: Agents are shuffled each loop for varied interaction patterns
  • Full Conversation Context: Every agent sees the complete conversation history from prior agents
  • Collaborative Prompting: Built-in prompts encourage agents to acknowledge and extend others’ contributions
  • Iterative Refinement: Multiple loops allow the group to progressively deepen their analysis
  • Automatic Retries: Exponential backoff retry logic for resilient agent execution

Architecture

Agents take turns, each reading the full conversation so far. The turn order is reshuffled at the start of 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 randomized each loop, so design prompts that work regardless of speaking position
  • Ideal for tasks where diverse perspectives and iterative refinement produce better results than parallel independent work