Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/user-guide/concepts/multi-agent/swarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ graph TD

## Creating a Swarm

To create a Swarm, you need to define a collection of agents with different specializations. The first agent in the list will receive the initial user request and act as the entry point for the swarm:
To create a Swarm, you need to define a collection of agents with different specializations. By default, the first agent in the list will receive the initial user request, but you can specify any agent as the entry point using the `entry_point` parameter:

```python
import logging
Expand All @@ -50,9 +50,10 @@ coder = Agent(name="coder", system_prompt="You are a coding specialist...")
reviewer = Agent(name="reviewer", system_prompt="You are a code review specialist...")
architect = Agent(name="architect", system_prompt="You are a system architecture specialist...")

# Create a swarm with these agents
# Create a swarm with these agents, starting with the researcher
swarm = Swarm(
[researcher, coder, reviewer, architect],
[coder, researcher, reviewer, architect],
entry_point=researcher, # Start with the researcher
max_handoffs=20,
max_iterations=20,
execution_timeout=900.0, # 15 minutes
Expand Down Expand Up @@ -84,6 +85,7 @@ The [`Swarm`](../../../api-reference/multiagent.md#strands.multiagent.swarm.Swar

| Parameter | Description | Default |
|-----------|-------------|---------|
| `entry_point` | The agent instance to start with | None (uses first agent) |
| `max_handoffs` | Maximum number of agent handoffs allowed | 20 |
| `max_iterations` | Maximum total iterations across all agents | 20 |
| `execution_timeout` | Total execution timeout in seconds | 900.0 (15 min) |
Expand Down