Skip to main content

AGENT ROUTER

Simplify the Complex, Amplify the Intelligent for Enterprise

Orchestrate multiple agents with ease: register agents, integrate tools, define custom instructions, and leverage multiple models. Enterprise-grade and production-ready, with full control, deep customization, strong defaults, clear boundaries, and developer-focused APIs.

Key Capabilities

Everything you need to build sophisticated multi-agent applications

🏗️
Hierarchical Agent Management
Create manager and worker agents with unlimited nesting. Build complex multi-agent systems with clear hierarchies and responsibilities. Share workers across multiple parents for maximum efficiency.
🚀
Enterprise-Ready
Production-grade with built-in error handling, logging, and monitoring. Configurable timeouts, retries, and isolation ensure reliability at scale with millions of users per day.
🔧
Tool Integration
Easy tool creation with OpenAI-compatible schemas. Register Python functions as tools with automatic validation. Support for async operations and complex tool chains.
🔒
Complete Isolation
Full isolation between agent instances ensures security and stability. Worker agents operate independently with controlled message passing and no internal state leakage.
🤝
OpenAI Compatible
Works seamlessly with OpenAI message formats and responses. Drop-in replacement for existing OpenAI integrations with enhanced multi-agent capabilities.
📊
Visual Tracing
Zero-overhead tracing with beautiful execution visualizations. Generate Mermaid diagrams, interactive HTML dashboards, and export execution data for analysis.

Architecture Overview

Hierarchical multi-agent system with unlimited nesting and tool integration

Manager AgentOrchestratorAPI Key, Model, ConfigWorker Agent L1Inventory MgmtInherits ConfigWorker Agent L1Payment ProcessShared WorkerWorker Agent L1Shipping CoordOwn API KeySub-Worker L2Stock VerificationSub-Worker L2Product InfoSub-Worker L2Fraud DetectionSub-Worker L2Route PlanningToolToolToolToolToolToolToolTool
Manager Agent
Worker Agent
Tool
Agent Communication
Tool Registration

Workflow Lifecycle

Intelligent orchestration with Planning Agent and Tool/Agent Calls

If more tools needed👤User TaskUser submits taskwith messages and optional history🧠Planning AgentAnalyzes task anddecides Tool and Agent calls🔧Tool and Agent CallsGenerates calls withproper parameters⚙️Execute Tools/WorkersAuto-executes registered toolsor worker agentsFinal ResponseGenerates final answerusing OpenAI SDK

Quick Start

Get up and running with AgentRouter in minutes

1

Install

Install AgentRouter SDK from PyPI with a simple pip command

2

Configure

Set up your manager agent with API key and model preferences

3

Build

Create workers, register tools, and define your workflow

4

Execute

Run your multi-agent system and handle complex tasks

# Install AgentRouter
pip install agentrouter

# Create your first multi-agent system
from agentrouter import ManagerAgent, WorkerAgent, tool

# Initialize Manager Agent
manager = ManagerAgent(
name="customer_service_manager",
api_key="your-api-key",
model="usf-mini",
backstory="Senior customer service manager",
goal="Resolve customer issues efficiently"
)

# Create Worker Agent
tech_support = manager.create_worker(
name="Technical_Support",
role="Diagnoses hardware/software issues, provides troubleshooting steps, and escalates complex technical problems" # REQUIRED
)

# Define a Tool
@tool(
schema={
"type": "function",
"function": {
"name": "search_knowledge_base",
"description": "Searches technical documentation for solutions, returns troubleshooting steps and fixes",
"parameters": {
"type": "object",
"properties": {
"query": {"type": "string"}
},
"required": ["query"]
}
}
}
)
def search_knowledge_base(query: str):
return {"results": f"Found solutions for: {query}"}

# Register the tool
tech_support.register_tool(search_knowledge_base)

# Execute a task
messages = [
{"role": "user", "content": "My laptop screen is flickering"}
]

response = await manager.execute(messages)
print(response)
🎯

Production Ready

Enterprise-grade with built-in error handling and monitoring

🔄

Fully Configurable

Customize timeouts, retries, and execution parameters

📈

Scalable

Handle millions of requests with isolated agent instances