Metadata-Version: 2.4
Name: swarmstate
Version: 0.1.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries
Requires-Dist: swarmstate[langgraph,crewai,redis] ; extra == 'all'
Requires-Dist: crewai>=0.70 ; extra == 'crewai'
Requires-Dist: pytest>=8.0 ; extra == 'dev'
Requires-Dist: ruff>=0.6 ; extra == 'dev'
Requires-Dist: mkdocs-material>=9.5 ; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.26 ; extra == 'docs'
Requires-Dist: langgraph>=0.2 ; extra == 'langgraph'
Requires-Dist: redis>=5.0 ; extra == 'redis'
Provides-Extra: all
Provides-Extra: crewai
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: langgraph
Provides-Extra: redis
License-File: LICENSE
Summary: Drop-in state backend for LangGraph, CrewAI & custom agent loops — Rust core, framework-agnostic, built for production.
Keywords: agents,langgraph,crewai,checkpoint,state,rust,multi-agent
Author: swarmstate
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://swarmstate.github.io
Project-URL: Homepage, https://github.com/swarmstate/swarmstate
Project-URL: Repository, https://github.com/swarmstate/swarmstate

# swarmstate

> Drop-in state backend for LangGraph, CrewAI & custom agent loops — Rust core, framework-agnostic, built for production.

`swarmstate` is a **state and checkpointing backend** with a Rust core and a Python API for multi-agent
systems. It is not an orchestration framework: it is the fast engine that sits *underneath* LangGraph,
CrewAI, and custom agent loops — the same way a fast columnar engine sits underneath data workloads.

It solves three production pains:

1. **State lock-in across frameworks** — a framework-agnostic store so migrating frameworks doesn't lose state.
2. **Checkpointing cost and latency** — a Rust-backed implementation of LangGraph's checkpointer interface.
3. **Deterministic routing paid for in tokens** — a native handoff graph that resolves rule-based transitions in microseconds.

## Installation

```bash
pip install swarmstate            # prebuilt abi3 wheels, no compiler required
```

Optional extras: `swarmstate[langgraph]`, `swarmstate[crewai]`, `swarmstate[redis]`, `swarmstate[all]`.

## Usage

```python
import swarmstate as ss

store = ss.Store()                              # in-memory, msgpack codec
store.set("workflow", "onboarding", {"step": 3, "data": {...}})
snap = store.snapshot()                          # cheap, immutable snapshot
store.set("workflow", "onboarding", {"step": 4})
store.restore(snap)                              # rollback
store.get("workflow", "onboarding")              # -> {"step": 3, "data": {...}}

snap2 = store.snapshot()
snap2.diff(snap)                                 # {"added": [...], "removed": [...], "changed": [...]}
```

## Status

Early development.

- **M0 (scaffolding)** ✅ — Rust core builds; `import swarmstate` works.
- **M1 (Rust store)** ✅ — concurrent KV store, msgpack codec, O(1) immutable snapshots,
  incremental diffs, GIL released on hot paths.
- **M2 (HandoffGraph)**, **M3 (LangGraph adapter)** — next.

## Development

```bash
python -m venv .venv && source .venv/bin/activate
pip install maturin pytest
maturin develop --release     # compile the Rust core and install it locally
cargo test                    # Rust core tests
pytest -q                     # Python API tests
```

## License

MIT

