Quick Start
Use Cases
Per-User Assistants
Each user gets their own AI with isolated state and history
Task Workers
Spawn independent agents for parallel task execution
Multi-Tenant APIs
Isolate AI state per customer or organization
Session Agents
Create agents for specific workflows or sessions
Architecture
The Agent Server uses an Agent Registry to route requests between local and remote agents.- Request:
POST /agent/user-123/chat - Registry: Matches
user-123to registered target (Agent class or Transport). - Execution:
- Local: Instantiates agent and executes locally
- Remote: Delegates to transport (HTTP, WebSocket, etc.)
Configuration
Basic (Single Agent Type)
The simplest way is to pass a single Agent class (or instance) to the server. This maps all IDs to that agent type.Advanced (Multi-Agent Registry)
UseAgentRegistry to serve different types of agents from the same server.
/agent/admin->AdminAgent("admin")/agent/chat-123->ChatBot("chat-123")/agent/worker-abc->TaskWorker("worker-abc")
Server Configuration
Control lifecycle and security withAgentServerConfig.
Endpoints
Client Examples
- Python (Client SDK)
- REST (HTTP)
- SSE (Server-Sent Events)
The recommended way to interact with the server.
Lifecycle Management
Idle Timeout
Agents with no connections are automatically evicted afteridle_timeout seconds:
Max Agents Limit
Reject new agents when limit is reached (returns 429 Too Many Requests):Lifecycle Hooks
Override hooks onAgentServer for custom logic:
Custom Routes
Add your own endpoints alongside the agent routes usingcreate_app().