Skip to content

Multi-Agent Systems

Multi-agent systems enable sophisticated conversation routing and specialized task handling by coordinating multiple AI agents. This documentation covers the implementation and configuration of multi-agent workflows.

Overview

Multi-agent systems support two primary architectures:

  • Triage Agent System: A hierarchical approach where a central triage agent routes conversations to specialized sub-agents
  • Custom Multi-Agent System: A flexible architecture for complex agent interactions and custom routing logic

We recommend starting with the triage agent system as it provides a simpler implementation path and easier testing framework.

Triage Agent System

Architecture

The triage agent system follows:

┌─────────────────┐
│  Triage Agent   │ ◄── Entry point for all conversations
└────────┬────────┘
    ┌────┴────┐
    │         │
┌───▼───┐ ┌──▼────┐
│Sales  │ │Know-  │
│Agent  │ │ledge  │
└───┬───┘ └──┬────┘
    │         │
    └────┬────┘
   Back to Triage

Implementation Guide

Step 1: Create the Agent Structure

Create three agents in your dashboard with the following hierarchy:

  1. Primary Triage Agent: Routes incoming queries to appropriate specialists
  2. Specialized Sub-Agents: Handle specific domains (e.g., Sales, Knowledge Base)

Step 2: Configure the Triage Agent

Agent Name:

Customer Service - Triage Agent

System Prompt:

{recommended_prompt_prefix}

You are a customer service triage agent responsible for routing conversations to the appropriate specialist. Your role is to:

1. Analyze incoming customer queries to determine intent and requirements
2. Route conversations to the most suitable specialist agent:
   - Sales Agent: For pricing, product features, purchasing decisions
   - Knowledge Base Agent: For technical support, how-to questions, troubleshooting
3. Maintain conversation context during handoffs
4. Ensure smooth transitions between agents

When routing, provide clear context to the receiving agent about the customer's needs and conversation history.

Sub-Agent Configuration:

sub_agents:
  - Sales Agent
  - Knowledge Base Agent

Step 3: Configure Specialist Agents

Sales Agent Configuration:

Name:

Customer Service - Sales Agent

System Prompt:

{recommended_prompt_prefix}

You are a sales specialist focused on helping customers make informed purchasing decisions. Your responsibilities include:

1. Presenting product features and benefits aligned with customer needs
2. Providing accurate pricing and availability information
3. Guiding customers through the purchase process
4. Identifying upsell and cross-sell opportunities
5. Handing back to the triage agent when queries fall outside sales scope

Maintain a consultative approach, focusing on understanding customer requirements before making recommendations.

Knowledge Base Agent Configuration:

Name:

Customer Service - Knowledge Base Agent

System Prompt:

{recommended_prompt_prefix}

You are a technical support specialist with comprehensive product knowledge. Your role encompasses:

1. Providing detailed technical assistance and troubleshooting
2. Offering step-by-step guidance for product usage
3. Explaining features and functionalities
4. Resolving common issues and errors
5. Escalating to triage agent for non-technical queries

Focus on clear, actionable solutions while maintaining technical accuracy.

Sub-Agent Configuration for Both Specialists:

sub_agents:
  - Triage Agent  # Enables return routing

Step 4: Testing and Deployment

  1. Initial Testing: Send test queries to the Triage Agent endpoint
  2. Verify Routing: Confirm appropriate agent selection based on query type
  3. Context Preservation: Ensure conversation history transfers correctly
  4. Handoff Testing: Validate smooth transitions between agents

Configuration Parameters

The {recommended_prompt_prefix} is a customizable instruction set that ensures consistent behavior across all agents:

You are part of a multi-agent customer service system. Always:
- Maintain professional, helpful communication
- Preserve conversation context during handoffs
- Clearly indicate when transferring to another agent
- Include relevant context when routing conversations

Best Practices

  1. Clear Role Definition: Each agent should have distinct, non-overlapping responsibilities
  2. Context Management: Implement robust context passing between agents
  3. Fallback Mechanisms: Always provide a path back to the triage agent
  4. Performance Monitoring: Track routing accuracy and conversation success rates
  5. Iterative Refinement: Continuously improve prompts based on conversation logs

Advanced Configuration

Custom Routing Logic

For complex routing requirements, extend the triage agent prompt:

Routing Priority:
1. Urgent technical issues → Knowledge Base Agent (immediate)
2. Purchase intent signals → Sales Agent (high priority)
3. General inquiries → Evaluate and route based on dominant theme
4. Ambiguous requests → Clarify before routing

Multi-Level Hierarchies

Create deeper agent structures for large-scale deployments:

Triage Agent
├── Technical Support Lead
│   ├── Hardware Specialist
│   └── Software Specialist
└── Sales Lead
    ├── Enterprise Sales
    └── Retail Sales

Troubleshooting

Common issues and solutions:

Issue Solution
Routing loops Ensure each agent has clear handoff conditions
Context loss Verify context passing in agent configurations
Incorrect routing Refine triage agent prompt with specific examples
Slow handoffs Optimize agent initialization and context loading

Custom Multi-Agent Systems

For advanced use cases requiring custom orchestration logic, refer to the Custom Agent Development Guide.

Performance Considerations

  • Latency: Each handoff adds processing time; minimize unnecessary transfers
  • Token Usage: Context passing increases token consumption; implement smart summarization
  • Scalability: Design agent hierarchies that can grow with your needs