Skip to main content

Swarm

Create a clustered multi-agent system. Swarm is a multi-agent architecture where agents dynamically hand over control to one another based on their respective expertise. The system remembers which agent was last active, ensuring that subsequent interactions continue with that agent.

Core Concept of Swarm Mode

Agents can pass requests to each other and share state (memory).

Swarm Agents
Swarm Agents

How to Orchestrateโ€‹

To implement the swarm mode in XpertAI digital expert agents, simply add call connections from sub-agents to the main agent to switch to swarm mode, while the Supervisor working mode remains available.

  • The large model selected must have tool-calling capabilities.

Prompt Designโ€‹

When setting prompts for a combination of agents in swarm mode, pay attention to the following points:

  • The prompt should clearly specify which tasks are handed over to which agent.
  • The prompt should indicate that control can only be transferred to one agent at a time, avoiding simultaneous transfers to multiple agents.

Conversationโ€‹

In the user conversation interface, you can directly interact with the entire digital expert system. The main agent will first receive the userโ€™s message, process it, or pass it to other agent members within the swarm, and so on. The roles of agent members within the swarm are equal (in contrast to the Supervisor mode, where sub-agents must return processed messages to the Supervisor agent, which then decides the next step in the conversation or whether it can end).

Conversational Swarm Agents
Conversational Swarm Agents