Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
cellz
SQLite-per-session, event-sourced state server for AI agents
Language-agnostic state & stream plane with atomic CAS leasing, Cloudflare R2 / S3 durability, and sub-millisecond local commits. Built in 100% Rust.
β‘ Positioning & Comparison with celld
While projects like denoland/celld bring Cloudflare Durable Objects to self-hosted environments by executing JavaScript/TypeScript Workers inside a sandbox, cellz takes a different, agent-focused path:
- Pure State & Stream Plane:
cellzdoes not execute user code inside the cell. It is completely language-agnostic, exposing REST, SSE, and WebSocket interfaces so agents written in Rust, Python, TypeScript, or Go can connect instantly. - Agent-Native Primitives: Built-in event sourcing, message materialization, key-value stores (Todos, Compactions), checkpointing, and branch rewinding.
- Atomic Single-Writer CAS Leases: Prevents split-brain across multiple distributed workers using S3
PutMode::Create/If-MatchETag conditional writes and atomic OS filesystem locks. - Dedicated Actor Thread: Each cell runs on its own OS thread with a single
rusqliteconnection. Snapshots (wal_checkpoint(TRUNCATE)) and state exports are serialized in the actor mailbox, eliminating race gaps between WAL writes and backup reads.CellHandleremains async. - Lossless Realtime Reconnection: SSE stream supports
Last-Event-IDand?since=query parameters to seamlessly replay historical missed events before transitioning to live broadcast.
ποΈ Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client / Web UI / Coding Agent β
ββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
β HTTP / SSE (Last-Event-ID) / WS
βΌ
ββββββββββββββββββββββββββββββββββββββββββ
β cellz β
β (Axum REST & Real-time Mesh) β
β β
β ββββββββββββββββββββββββββββββββββββ β
β β Session Cell (Actor) β β
β β - Monotonic Event Sourcing β β
β β - Materialized Message Projectionβ β
β β - Key-Value State Machine β β
β β - Dedicated SQLite (WAL Mode) β β
β β - Mailbox-Serialized Snapshots β β
β ββββββββββββββββββ¬ββββββββββββββββββ β
βββββββββββββββββββββΌβββββββββββββββββββββ
β
ββββββββββββββββββββββ΄βββββββββββββββββββββ
βΌ βΌ
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ
β Local Cell SQLite DBs β β Blob Storage Engine β
β `data/cells/{id}.db` β β (Local FS / S3 / R2) β
β (Microsecond Latency) β β (CAS Leases & Snapshots)β
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ
For in-depth architectural details, refer to Architecture Specification.
π Quick Start
Install from crates.io
Embed the Axum router in your own process:
# HTTP daemon API (default)
= "0.2"
# In-process core only β no Axum / object_store (gitcell, embed)
= { = "0.2", = false }
# + S3 / Cloudflare R2 snapshots
= { = "0.2", = ["s3"] }
use Arc;
use CellManager;
use Config;
use LocalBlobStore;
let config = default;
let storage = new;
let manager = new;
With the default server feature, cellz::create_router(manager) exposes the HTTP / SSE / WebSocket API.
Cargo features
| Feature | Default | What it enables |
|---|---|---|
| (core, always on) | β | Per-cell SQLite, event sourcing, messages, KV, checkpoints, LocalBlobStore |
server |
yes | Axum HTTP + SSE + WebSocket daemon (create_router) |
s3 |
no | S3BlobStore via object_store (S3 / Cloudflare R2) |
Event sourcing is the write model of a cell and is not feature-gated.
1. Run the Daemon from source
# Local filesystem storage (from source)
# Or with Cloudflare R2 / S3
2. Configuration Options
cellz is configured via environment variables:
| Environment Variable | Default Value | Description |
|---|---|---|
CELLZ_HOST |
0.0.0.0 |
Bind IP address |
CELLZ_PORT |
8080 |
Listen port |
CELLZ_DATA_DIR |
./data/cells |
Local SQLite databases storage path |
CELLZ_STORAGE_DIR |
./data/storage |
Snapshot backup & lease directory (local backend) |
CELLZ_LEASE_TTL |
60 |
Lease lock expiry duration in seconds |
CELLZ_STORAGE_BACKEND |
local |
Storage backend (local or s3) |
CELLZ_S3_ENDPOINT |
None | S3 / Cloudflare R2 endpoint URL |
CELLZ_S3_BUCKET |
None | S3 / Cloudflare R2 bucket name |
CELLZ_S3_ACCESS_KEY_ID |
None | S3 Access Key ID |
CELLZ_S3_SECRET_ACCESS_KEY |
None | S3 Secret Access Key |
CELLZ_S3_REGION |
auto |
S3 Region (auto for Cloudflare R2) |
3. Create a Session & Append Events
# 1. Create a new Cell
# 2. Append a user message
# 3. Retrieve projected messages
# 4. Subscribe to real-time events via SSE
Full API documentation and request/response payloads are available in API Reference.
π§ͺ Testing & Quality Gates
Run full test suite:
Run linter:
π Documentation Index
- Architecture Specification: Per-cell SQLite, dedicated actor thread, cargo features, and lease management.
- API Reference: Complete REST, SSE, and WebSocket endpoints specification.
- Changelog: Released crate versions.
- Admin UI Kit: Admin console UI framework and component catalog.
π License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.