Skip to main content

Crate cellz

Crate cellz 

Source
Expand description

SQLite-per-session, event-sourced state server for AI agents.

cellz is a language-agnostic state and stream plane. Each session is a single-writer SQLite cell with event sourcing, message projection, KV state, and checkpoints. Enable server (default) for lossless SSE / WebSocket replay over HTTP. Enable s3 for durable leases and snapshots on S3 / Cloudflare R2; the default blob backend is the local filesystem.

§Install the daemon

cargo install cellz
cellz

S3 / R2 support: cargo install cellz --features s3.

§Embed as a library

In-process core — no HTTP stack, no object_store:

use std::sync::Arc;

use cellz::cell::CellManager;
use cellz::config::Config;
use cellz::storage::LocalBlobStore;

let config = Config::default();
let storage = Arc::new(LocalBlobStore::new(&config.storage_dir));
let manager = CellManager::new(
    &config.data_dir,
    storage,
    config.lease_ttl_secs,
);
let _handle = manager
    .create_cell(Some("agent-1".into()), Some("demo".into()), None)
    .await?;
# gitcell / in-process embed
cellz = { version = "0.2", default-features = false }

# HTTP daemon API (default)
cellz = "0.2"

# + S3 / R2 snapshots
cellz = { version = "0.2", features = ["s3"] }

Re-exports§

pub use config::Config;
pub use error::Error;
pub use error::Result;
pub use server::create_router;

Modules§

api
HTTP handlers and WebSocket/SSE streaming endpoints.
cell
Per-cell actor, SQLite store, and activation manager.
config
error
model
Request/response and event-sourcing data models.
server
HTTP router assembly for the cellz daemon and embeddable library.
storage
Local filesystem blob storage with CAS leases.