What is a Remote Agent Server?
A Remote Agent Server is an HTTP/WebSocket server that:- Package the Agent SDK into containers and deploy on your own infrastructure (Kubernetes, VMs, on-prem, or cloud)
- Runs agents on dedicated infrastructure
- Manages workspaces (Docker containers or remote sandboxes)
- Streams events to clients via WebSocket
- Handles command and file operations (execute command, upload, download), check base class for more details
- Provides isolation between different agent executions
Architecture Overview
Remote Agent Servers follow a simple three-part architecture:- Client (Python SDK) — Your application creates and controls conversations using the SDK.
- Agent Server — A lightweight HTTP/WebSocket service that runs the agent and manages workspace execution.
- Workspace — An isolated environment (local, Docker, or remote VM) where the agent code runs.
How Remote Conversations Work
Each step in the diagram maps directly to how the SDK and server interact:1. Workspace Connection → (Client → Server)
When you create a conversation with a remote workspace (e.g.,DockerWorkspace or APIRemoteWorkspace), the SDK automatically starts or connects to an agent server inside that workspace:
Conversation into a RemoteConversation that speaks to the agent server over HTTP/WebSocket.
2. Server Initialization → (Server → Workspace)
Once the workspace starts:- It launches the agent server process.
- Waits for it to be ready.
- Shares the server URL with the SDK client.
3. Event Streaming → (Bidirectional WebSocket)
The client and agent server maintain a live WebSocket connection for streaming events:4. Workspace Supports File and Command Operations → (Server ↔ Workspace)
Workspace supports file and command operations via the agent server API (base class), ensuring isolation and consistent behavior:Summary
The architecture makes remote execution seamless:- Your client code stays the same.
- The agent server manages execution and streaming.
- The workspace provides secure, isolated runtime environments.
Next Steps
Explore different deployment options:- Local Agent Server - Run agent server in the same process
- Docker Sandboxed Server - Run agent server in isolated Docker containers
- API Sandboxed Server - Connect to hosted agent server via API
- Agent Server Package Architecture - Remote execution architecture and deployment

