Skip to main content

Complete Multi-Agent Setup

This guide walks through setting up a complete multi-agent system using the unified transport layer, including both local and remote agents with different deployment patterns.

Overview

We’ll build a content creation system with three agents:
  • Coordinator Agent (local) - Orchestrates the workflow
  • Researcher Agent (remote) - Handles research tasks
  • Writer Agent (remote) - Creates content based on research

Project Structure

Step 1: Define the Agents

Researcher Agent

Writer Agent

Coordinator Agent

Step 2: Set Up Servers

Remote Server (Researcher + Writer)

Local Server (Coordinator)

Step 3: Create Client

Step 4: Environment Configuration

Create a .env file:

Step 5: Deployment Options

Local Development

Docker Deployment

Dockerfile for remote server:
docker-compose.yml:

Serverless Deployment (Vercel)

api/remote/[…agent_id].py:
api/coordinator/[…agent_id].py:

Step 6: Running the Example

Local Setup

  1. Install dependencies:
  2. Set environment variables:
  3. Start servers:
  4. Run client:

Docker Setup

Step 7: Testing the System

The client will output something like:

Advanced Features

Adding More Agents

To add more agents:
  1. Define new agent class
  2. Register in appropriate server
  3. Update coordinator to use new agent
  4. Deploy changes

Load Balancing

For multiple remote agents:

Error Handling

Add retry logic:

Monitoring and Debugging

Health Checks

Logging

Summary

This complete example demonstrates: ✅ Multi-agent architecture with local and remote agents
✅ Unified transport layer for seamless communication
✅ Flexible deployment options (local, Docker, serverless)
✅ Error handling and retry logic
✅ Scalability patterns for production use
The system can be extended with more agents, different deployment patterns, and advanced features based on your specific needs.