open-source memory runtime for AI agents — reproducible, provenance-tagged context bundles instead of query-time retrieval
★ 297Pythonsmaramwbc/statewave

What it is: Statewave is a new open-source memory runtime for AI agents that makes one contrarian bet: don't retrieve memory at query time. Compile it once, sign it, and hand your agent a reproducible context bundle it can prove it received. It's Apache-2.0, self-hosted on Postgres, and ships with the governance features — audit receipts, sensitivity labels, hard deletion — that the incumbent memory layers make you build yourself.

Who it's for: Founders shipping agents into anything regulated, audited, or contested — support bots that touch customer PII, agents operating under a data-deletion or AI-persona law, anything where "why did the agent say that?" is a question you might have to answer to someone who isn't you.

The problem it solves#

Every popular memory layer retrieves at query time. Your agent asks "what do I know about Alice?", the store runs a fresh vector search, and hands back whatever ranks highest right now. Ask again a minute later, after one more add(), and you can get a different set of facts. That's fine for a chatbot remembering a coffee order. It's a problem the moment someone asks you to reconstruct what your agent knew at 3:47pm on Tuesday, because the honest answer with a live retrieval store is: I can't tell you — it would retrieve something slightly different now.

Statewave replaces "retrieve on every call" with ingest → compile → use. Raw events go in. It compiles them into typed memories once per subject change. Then, on demand, it assembles a ranked, token-bounded bundle — and that bundle is deterministic: the README's own promise is that "the same query against the same subject at the same point in time always produces the same bytes."

Query-time retrieval optimizes for the best answer now. Statewave optimizes for the same answer twice — which is what an audit, a rollback, and a court order all actually need.

The one real idea: a receipt for context#

Determinism only matters if you can prove it, and that's the part worth the highlight. Every bundle Statewave assembles carries a state-assembly receipt: a ULID-addressable, HMAC-SHA256-signed record of exactly which compiled memories influenced it. You keep the receipt. Later — when a customer disputes what the agent did, or an auditor asks what it knew — you can replay that historical retrieval against current memories and the original policy and see precisely what the agent saw and how it has changed since.

Think of it as version control for your agent's context. Mem0 and Zep can tell you what's in the store; Statewave can tell you what the agent was handed, and sign its work.

Governance is in the layer, not your backlog#

The other thing incumbents leave to you, Statewave ships:

How you run it#

Self-hosted only, on your own Postgres — which for the audit use case is the point, not a limitation.

# one command: API (:8100), admin console, and Postgres
npx @statewavedev/statewave
# or
docker compose up -d

You need PostgreSQL 14+ with pgvector ≥ 0.4.2. The API process is CPU-only — the default compiler is a local heuristic, so you don't need a GPU to start. Want richer compilation? It uses LiteLLM under the hood, so you can point it at any of 100+ providers:

STATEWAVE_COMPILER_TYPE=llm
STATEWAVE_LITELLM_API_KEY=sk-...
STATEWAVE_LITELLM_MODEL=gpt-4o-mini

SDKs are pip install statewave (Python 3.11+) and npm install @statewavedev/sdk. And because it ships an MCP connector (@statewavedev/connectors-mcp), you can wire it straight into Claude, Cursor, or Copilot as a memory tool without writing glue.

The honest caveat#

It's early. Statewave is v1.x with roughly 300 GitHub stars, against Mem0's 60k-plus and Graphiti's ~28k. The connector ecosystem is small, and you'll be an early adopter filing the first issues. The architecture is genuinely ahead of the incumbents on auditability — but "ahead on the thing you need" and "battle-tested" are different claims, and only one of them is true here yet.

The one-line take#

If your agent's memory is a compliance surface — PII, deletion rights, disputes you might have to reconstruct — Statewave is the first memory layer that treats "prove what the agent knew" as a first-class feature instead of your problem. Pilot it against Mem0 or Zep on one subject type, keep the incumbent as your fallback, and see whether a signed, reproducible bundle changes how much you sleep.