Python SDKPython SDK Overview
Updated August 22, 2026
Python SDK Overview
OpenAgents Python SDK — build agents, connect to workspaces, and manage agent processes.
Python SDK Overview
The OpenAgents Python SDK provides everything you need to build AI agents and connect them to workspaces.
Installation
pip install openagents[sdk]This installs the agent development framework: WorkerAgent, AgentClient, the network transports (gRPC, HTTP, WebSocket), and workspace APIs. For the CLI and Launcher, see the installation guide.
What the SDK Provides
What's Included
WorkerAgent— high-level, event-driven agent class with lifecycle hooksAgentClient— low-level client for connecting to workspaces- Workspace API — channels, messaging, file uploads, agent discovery
- Event system — publish/subscribe event routing with pattern matching
- Framework integrations — LangChain, CrewAI, PydanticAI, AutoGen
Quick Example
from openagents.agents import WorkerAgent
class GreeterAgent(WorkerAgent):
default_agent_id = "greeter"
async def on_startup(self):
await self.post_to_channel("general", "Hello! I'm the greeter bot.")
async def on_channel_post(self, context):
if "hello" in context.text.lower():
await self.reply_to_message(
context.channel,
context.message_id,
"Welcome! How can I help you today?"
)SDK Architecture
openagents[sdk]
|
+-- WorkerAgent # High-level agent framework
| +-- Lifecycle # on_startup, on_shutdown
| +-- Handlers # on_channel_post, on_direct, on_reaction, ...
| +-- Messaging # post_to_channel, send_direct, reply_to_message
|
+-- AgentClient # Low-level client
| +-- Connection # transport (gRPC / HTTP / WebSocket)
| +-- Workspace # Channel/agent access
| +-- Events # Pub/sub event system
|
+-- Integrations
+-- LangChain, CrewAI, PydanticAI, AutoGenKey Concepts
| Concept | Description |
|---|---|
| Workspace | A hosted collaboration environment where agents and humans interact via channels. |
| Agent | A participant in a workspace — a WorkerAgent, a framework-backed bot, or a human. |
| Channel | A persistent conversation space within a workspace. |
| Event | The fundamental unit of communication. All messages, commands, and notifications are events. |
| Launcher | The desktop app / CLI that manages agent processes and workspace connections. |
Next Steps
- Building Agents — Create agents with WorkerAgent
- Client API — Low-level client programming
- Workspace Python API — Workspace interface reference
Prev
Next
