TryCaspian/caspian-sdk
A Python and TypeScript SDK that routes multiple messaging channels to one agent.
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Caspian is a transport layer for human-facing agents, not a reasoning runtime. Channel adapters verify inbound traffic, normalize payloads into kernel events, and dispatch those events to declarative message or action handlers. Handlers work with a common Thread and Message model; replies use the thread context to reach the originating conversation. Rules are inspectable through cx.app.rules, with overlap policies such as queue, debounce, drop, and parallel affecting what happens when messages arrive while a handler is busy.
The 1.0 facade lives in packages/python and packages/typescript. Hosted bindings poll a gateway; self-hosted bindings run adapters in the application process behind a webhook route or, for supported channels, a socket listener. The root uv workspace links the local Python package and configures pytest against packages/python/tests. The Bun CLI in packages/cli uses the SDK command surface; OpenClaw and OpenCode integrations are separate packages rather than prerequisites for message dispatch.
Key Capabilities & Differentiators
The SDK handles threaded replies, immediate acknowledgements, typing indicators, media, reactions, and callback actions. Streaming is implemented by posting once and editing the message as content arrives. Rich blocks map to native representations such as Slack Block Kit, Discord embeds, and Telegram keyboards, with plain-text fallback where needed. cx.tools(thread) exposes schemas derived from the same command catalog that handlers use; it does not choose or run a model.
Channel availability depends on deployment mode. The 1.0 matrix lists local Telegram bot webhooks or polling, Discord socket inbound, and Slack sockets or webhooks, alongside adapters for channels including email, WhatsApp Business, and Twilio SMS or voice. Linear is listed as self-host only; Bluesky and Instagram DM are listed as hosted only. Inbound verification is provider-specific, including Slack signing secrets, Meta X-Hub-Signature-256, and Telegram's secret header. The offline fakes exercise platform-shaped payloads without live provider calls.
Trade-offs & Limitations
Compared with native channel SDKs, Caspian removes duplicate routing, reply handling, and test scaffolding when several channels share an agent. The cost is an abstraction boundary: rich-message behavior and channel availability still vary, so verify every required channel and feature in the intended mode. The common thread model routes replies, but do not treat it as evidence of automatic identity matching across platforms. For a single-channel application that depends on native features, a direct integration may be simpler.
Hosted mode reduces the inbound infrastructure you operate but adds a gateway dependency and a polling path. Direct self-hosting gives you control over ingress and tokens while leaving endpoint availability, credentials, and socket operations to your team. It does not remove upstream constraints: X DMs require paid API access, and GSM-modem SMS requires a modem, SIM, and attention to carrier rules. Review AGPL-3.0 obligations before modifying and operating the software as a network service.
Hardware & Deployment Guide
The SDK requires Python 3.10+ or, for TypeScript, Node.js 18+ or Bun. For hosted use, configure CASPIAN_API_KEY and run cx.run() to poll the gateway; CASPIAN_BASE_URL can override the endpoint. In-process self-hosting uses platform credentials and your own ingress: route HTTP requests to cx.handle() in Python or the channel webhook handler in TypeScript. Slack and Discord socket inbound can avoid a public webhook URL; the Python Discord listener requires the optional caspian-sdk[discord] extra.
The Docker Compose path is a separate gateway setup. It builds ./server, publishes port 8000, uses PostgreSQL and an inline worker, and defaults to a credential-free fake provider and a development bootstrap key. Replace that key before exposing the service. The v0.1.2 release covers the first public open core, the Compose quickstart still targets CommClient, and the SDK examples describe the 1.0 Caspian rewrite. These are distinct surfaces: pin a matching package and gateway revision before deployment rather than assuming the legacy Compose example works with the 1.0 SDK.
cx.app.rules apply channel, chat-kind, and command filters, with acknowledgement and overlap policies.Thread supports contextual replies, rich blocks with text fallback, and streaming by editing a posted message.caspian-sdk/telegram for parse, plan, and execute without the full SDK facade.cx.tools(thread) exposes kernel-derived command schemas; the Bun CLI offers catalog, call, and threads tail.Support assistants and community bots that should share handler logic across email, Slack, Telegram, or Discord while replying in the originating thread.
You only need one channel's native features, require a channel unavailable in your chosen deployment mode, or need agent-to-agent interoperability rather than human messaging.
Quick Start & Installation
pip install caspian-sdk # Python 3.10+ npm install caspian-sdk # TypeScript / Node 18+ / Bun
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| caspian-sdk ★ | 970 | +2 | Python | AGPL-3.0 | A Python and TypeScript SDK that routes multiple messaging channels to one agent |
| browser-use | 122.7k | +477 | Python | MIT | Python REPL and CDP for adaptive browser automation |
| langgraph | 45.8k | +293 | Python | MIT | Python graph orchestration for stateful, resumable agents and workflows |
| langchain | 150.4k | +290 | Python | MIT | Modular Python framework for building agents across model providers |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/TryCaspian/caspian-sdk.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about caspian-sdk
How do I connect an existing agent without rewriting its reasoning loop?
channels.add() and call your agent from an on_message handler. Use the provided Thread to reply in context. Hosted inbound arrives through cx.run() polling; for an in-process webhook adapter, pass the request body and headers to cx.handle(). For Slack or Discord socket inbound, use cx.listen() where supported.Does the SDK need a GPU, and how should I size it?
Can we self-host Caspian for a commercial product?
When are native channel SDKs or agent-to-agent protocols a better fit?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy