Python SDK
Official Python implementation of the ARC Protocol.
Installation
pip install arc-sdk # Core
pip install arc-sdk[pqc] # + Post-Quantum Cryptography
pip install arc-sdk[fastapi] # + FastAPI integration
pip install arc-sdk[starlette] # + Starlette integration
pip install arc-sdk[all] # All integrations (excludes PQC)
pip install arc-sdk[all,pqc] # Complete installation
Quick Links
- Getting Started - Quick start guide
- Client Documentation - ARCClient and ThreadManager
- Server Documentation - ARCServer and agent handlers
- State Management - ChatManager and storage
- Integrations - FastAPI and Starlette
- Quantum-Safe TLS - Post-quantum cryptography
- Streaming - Server-Sent Events patterns
Documentation Structure
Client
Client-side ARC Protocol communication.
- Task Methods - Asynchronous task operations
- Chat Methods - Real-time chat operations
- ThreadManager - WebSocket session management
- Responses & Errors - Response handling and error management
Server
Server-side ARC Protocol handling.
- Agent Handlers - Agent registration and routing
- Authentication - OAuth2 and JWT validation
- Middleware - Custom middleware and health checks
State Management
Server-side state and session management.
- ChatManager - Chat session mapping
- Storage Backends - Redis, PostgreSQL, MongoDB
- Framework Integration - LangChain, LlamaIndex
Integrations
Framework integrations for ARC servers.
Quantum-Safe TLS
Post-quantum cryptography with hybrid TLS.
- Hybrid TLS - X25519 + Kyber-768 implementation
- Installation - Build requirements and setup
Streaming
Server-Sent Events patterns.
- SSE Streaming - Real-time streaming implementation
- Client Streaming - Client-side streaming consumption
- Server Streaming - Server-side streaming generation
Core Components
ARCClient
HTTP client for ARC Protocol requests.
from arc import Client
client = Client("https://api.example.com/arc", token="your-token")
task = await client.task.create(target_agent="analyzer", initial_message={...})
ARCServer
FastAPI-based server for handling ARC requests.
from arc import Server
server = Server(server_id="my-server")
@server.agent_handler("my-agent", "chat.start")
async def handle_chat(params, context):
return {"type": "chat", "chat": {...}}
ChatManager
Maps ARC chat_id to framework thread_id.
from arc.core.chat import ChatManager
chat_manager = ChatManager(agent_id="my-agent", storage=storage)
await chat_manager.create_chat(chat_id="chat-123", metadata={...})
ThreadManager
Client-side thread management for WebSocket sessions.
from arc.client import ThreadManager
thread_manager = ThreadManager(arc_client)
response = await thread_manager.send_to_agent("agent-id", message)
Features
- Full ARC Protocol implementation
- Quantum-safe hybrid TLS (X25519 + Kyber-768)
- FastAPI and Starlette integration
- OAuth2 authentication with scope validation
- SSE streaming support
- Multi-agent routing
- Workflow tracing
- Persistent session storage (Redis, PostgreSQL, MongoDB)
Examples
Links
- GitHub: arcprotocol/python-sdk
- PyPI: arc-sdk
- Specification: ARC Protocol