Creating Multi-Agent Teams

xpander.ai allows you to create teams of specialized agents that work together to accomplish complex tasks.

For example, you can create a team of agents that work together to gather news from multiple sources, analyze the news, and then summarize the results.

Here’s how to set up a multi-agent team:

1

Access Teams View

Click on the “Agent Teams” tab in the navigation bar to view your existing teams or create a new one.

2

Create New Team

Click the “Create AI Agents Team” button to start building your team.

3

Add Agents

  1. Click the “Add Agent” button in your team workspace
  2. Select agents from the dropdown menu (e.g., HN Story Fetcher, LinkedIn AI Agent)
  3. Click “Done” to add the selected agents to your team

4

Configure Team Layout

By default, agents operate independently. To enforce sequential execution:

  1. Click the “Builder” tab to access the visual canvas

  2. Change the layout type from “Router” to “Sequence” in the Delegation settings

  3. Draw connection lines between agents to define their execution order

5

Manager Layout

For more dynamic team coordination, use the Manager layout:

  1. Select “Manager” layout type in Delegation settings
  2. Configure the manager agent with high-level instructions
  3. The manager agent will:
    • Analyze incoming tasks
    • Determine optimal agent sequence
    • Handle data passing between agents
    • Monitor overall execution progress

This layout provides flexible, AI-driven orchestration where the manager agent intelligently decides how to coordinate the team and pass information between agents based on the task requirements.

After changing to sequence layout, you must draw connection lines between agents to define their execution order. Without these connections, the agents won’t know how to pass information between each other.

Executing Multi-Agent Teams Programmatically

You can execute multi-agent workflows programmatically using the xpander.ai SDK. The general pattern involves:

  1. Setting up the environment with necessary API keys
  2. Loading the agents that will participate in the workflow
  3. Executing the agent sequence with proper information passing between agents

Core Execution Pattern

The core execution pattern for multi-agent workflows follows these steps:

  1. Configure your environment with OpenAI and xpander.ai API keys
  2. Initialize both the xpander.ai and OpenAI clients
  3. Load your agent or agents from xpander.ai
  4. Create and initialize a task with appropriate context
  5. Execute a loop that:
    • Generates LLM responses using the current agent’s tools
    • Processes any tool calls made by the LLM
    • Handles transitions between agents in sequence

Execution Approaches

There are two main approaches to executing multi-agent teams:

For most use cases, the simplified approach is recommended as it handles all the complexity of agent transitions automatically. Only use the direct control approach when you need to insert custom processing logic between agent steps.

Testing and Monitoring Multi-Agent Teams

Once your team is configured, you can test it through multiple interfaces provided by xpander.ai:

The chat interface provides a conversational way to interact with your team:

  1. Click the “Chat” button in the team workspace
  2. Enter your task or query
  3. Watch as agents collaborate to complete the task
  4. Review the final output and agent interactions