Skip to main content

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

Documentation Structure

Client

Client-side ARC Protocol communication.

Server

Server-side ARC Protocol handling.

State Management

Server-side state and session management.

Integrations

Framework integrations for ARC servers.

Quantum-Safe TLS

Post-quantum cryptography with hybrid TLS.

Streaming

Server-Sent Events patterns.

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