v0.2.0 — Now with ML & Async support

State that knows
why it changed.

A causal computing framework that makes every state transition transparent, explainable, and auditable — built for systems where understanding matters.

Get started GitHub
from statebits import Statebit

# Every change carries its reason
account = Statebit(identity="account_123", initial_value=1000.0)

account.transition(1500.0, "Wire transfer received", confidence=1.0)
account.transition(1450.0, "ATM withdrawal", confidence=1.0)

# Ask why — get a full audit trail
print(account.explain())

State management
without black boxes.

Traditional frameworks treat state changes as opaque events. Statebits records the reason, the confidence, and the context — always.

Causal Tracking

Every transition stores the reason, confidence level, and full context. Nothing is ever lost.

Explainable

Built-in tools to articulate exactly how and why the state reached its current value.

Auditable

Complete tamper-evident history with integrity verification — ready for compliance.

Predictive

ML-powered prediction based on historical patterns — know what comes next.

Distributed

Redis-backed distributed state, WebSocket streaming, and GraphQL API — built in.

Flexible

Simple scripts to enterprise multi-tenant systems — one framework, any scale.

Precision at
every layer.

01

Transparent Transitions

Every state change is a first-class record — not just a value, but a reason, a timestamp, a confidence level, and the context that caused it.

reason tracking confidence levels full context
from statebits import Statebit, ConfidenceLevel

temp = Statebit(
  identity="room_temp",
  initial_value=20.0
)

temp.transition(
  22.0,
  "Heater turned on",
  confidence=ConfidenceLevel.HIGH
)

# Ask why
print(temp.explain())
02

Fork & Merge

Simulate alternative futures without touching production state. Fork a branch, run scenarios, and merge back — or discard entirely.

simulation branching merge strategies
# Fork for safe simulation
sim = account.fork(
  reason="Testing withdrawal"
)

sim.transition(500, "Large purchase")

# Merge back if valid
account.merge(
  sim,
  strategy='latest'
)
03

ML-Powered Prediction

LSTM, Transformer, and AutoML models learn from your history to predict what comes next. With anomaly detection and explainable AI built in.

LSTM/Transformer AutoML SHAP explanations anomaly detection
from statebits import StatebitsML

ml = StatebitsML()
prediction = ml.predict_next_state(
  statebit
)

print(
  f"Next: {prediction['prediction']}"
)
print(
  f"Conf: {prediction['confidence']}"
)

Built for systems
where trust is critical.

Statebits was designed for domains where every decision must be traceable and defensible.

AI & Machine Learning

Track model training, explain predictions, and maintain full audit trails across experiments.

Finance & Trading

Transparent transaction ledgers with reasoning chains — compliance-ready by design.

Healthcare

Track patient state with full context and confidence levels. Meets audit and safety requirements.

IoT & Smart Systems

Distribute device state across Redis clusters with real-time streaming and full history.

Supply Chain

Track goods from warehouse to delivery — every handoff signed, timestamped, and explained.

Enterprise

Multi-tenancy, RBAC, encrypted state, and monitoring dashboards for complex organizations.

One command
to start knowing why.

pip install statebits
async_support distributed streaming graphql timeseries encryption ml enterprise