Skip to main content

Statehouse

Strongly consistent state for AI agents and workflows

Run Statehouse in 3 steps

1. Start the daemon (Docker)

No Rust needed. One command to run the Statehouse daemon on localhost:50051:

docker run -d -p 50051:50051 --name statehouse rtacconi/statehouse:latest

2. Install the Python SDK

pip install statehouse

To install from source: clone the repo, then run pip install -e . from the python/ directory.

3. Use it: versioned state + replay

Statehouse gives you versioned state and replay so you can see exactly what an agent wrote and when. Run this:

from statehouse import Statehouse

client = Statehouse(url="localhost:50051")

# Write agent state (each write is versioned and immutable)
with client.begin_transaction() as tx:
tx.write(
agent_id="my-agent",
key="research_context",
value={"task": "Summarize report", "sources": ["doc1", "doc2"]},
)

with client.begin_transaction() as tx:
tx.write(
agent_id="my-agent",
key="research_context",
value={
"task": "Summarize report",
"sources": ["doc1", "doc2"],
"summary": "Key finding: emissions down 10%.",
},
)

# Read current state (with version number)
result = client.get_state(agent_id="my-agent", key="research_context")
print(f"Version {result.version}: {result.value}")
# Version 2: {'task': '...', 'sources': [...], 'summary': 'Key finding: ...'}

# Replay full history — audit trail of what the agent did
for event in client.replay(agent_id="my-agent"):
for op in event.operations:
print(f" [{event.commit_ts}] {op.key} -> version {op.version}")

You get: transactions (all-or-nothing writes), versions on every key, and replay for debugging and compliance.


What is Statehouse?

Statehouse is a strongly consistent state and memory engine for AI agents and workflows. It provides durable, versioned, replayable state so agent-based systems can be debugged, audited, and trusted in production. It is self-hosted infrastructure, not a cloud service.

Why Statehouse?

Agents are stateful: they remember context, make decisions, and evolve over time. Statehouse makes that state boring, correct, and inspectable — with transactions, versions, and full replay instead of ad-hoc databases and JSON blobs.