A causal computing framework that makes every state transition transparent, explainable, and auditable — built for systems where understanding matters.
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())
Why Statebits
Traditional frameworks treat state changes as opaque events. Statebits records the reason, the confidence, and the context — always.
Every transition stores the reason, confidence level, and full context. Nothing is ever lost.
Built-in tools to articulate exactly how and why the state reached its current value.
Complete tamper-evident history with integrity verification — ready for compliance.
ML-powered prediction based on historical patterns — know what comes next.
Redis-backed distributed state, WebSocket streaming, and GraphQL API — built in.
Simple scripts to enterprise multi-tenant systems — one framework, any scale.
Core Features
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.
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())
Simulate alternative futures without touching production state. Fork a branch, run scenarios, and merge back — or discard entirely.
# Fork for safe simulation sim = account.fork( reason="Testing withdrawal" ) sim.transition(500, "Large purchase") # Merge back if valid account.merge( sim, strategy='latest' )
LSTM, Transformer, and AutoML models learn from your history to predict what comes next. With anomaly detection and explainable AI built in.
from statebits import StatebitsML ml = StatebitsML() prediction = ml.predict_next_state( statebit ) print( f"Next: {prediction['prediction']}" ) print( f"Conf: {prediction['confidence']}" )
Use Cases
Statebits was designed for domains where every decision must be traceable and defensible.
Track model training, explain predictions, and maintain full audit trails across experiments.
Transparent transaction ledgers with reasoning chains — compliance-ready by design.
Track patient state with full context and confidence levels. Meets audit and safety requirements.
Distribute device state across Redis clusters with real-time streaming and full history.
Track goods from warehouse to delivery — every handoff signed, timestamped, and explained.
Multi-tenancy, RBAC, encrypted state, and monitoring dashboards for complex organizations.
Get Started