Skip to content
Open-source memory runtime · Apache-2.0

Memory for AI agents.
Every answer traces
back to its source.

Persistent memory for your agents, with a signed receipt for every answer. Runs on your Postgres.

npx @statewavedev/statewave
Statewave Support

Ask the Statewave docs

Setup, deployment, privacy or compiler questions. Every answer comes from the docs memory pack and cites its source. When something isn't covered, the agent says so.

  • Citedevery claim
  • Groundedofficial docs
  • Honestabout gaps
The problem

AI agents forget.
Every session starts from zero.

Without a memory runtime, an AI agent starts every session from zero, and when it gets an answer wrong, nobody can say what it was told.

Try both agents live →
Support agentaccount:northwind · session 3 · 30 SepNo receipt
What the agent remembers
  1. Session 12 Sep · chatNothing recalled
  2. Session 29 Sep · ZendeskNothing recalled
When does our plan renew, and can you resend the May invoice?
N
Your plan renews on the 1st. Could you explain the issue with the May invoice again?
Sourcesep 7c1e04a2 · 2 Sepep e2a6c35b · 9 Sep
Prior sessions recalled
0
Stale facts superseded
0
Receipt
None
How it works

Three calls. One receipt.

Statewave is a memory runtime with three API calls: record episodes, compile them into typed memories, and retrieve a token-bounded context bundle with an optional signed receipt.

2 Sep9 Sepearlierrenewal · 14thINV-2291 · refundedrenewal · 1st12341,284 / 2,000receipt ✓EPISODESMEMORIESBUNDLE
Governance

Memory you can govern.
Not just retrieve.

Statewave ships the controls a memory layer needs before it touches production data: sensitivity labels, declarative policies, signed receipts, provenance, tenant isolation and subject-level erasure.

How Statewave governs memory →

Memories carry sensitivity labels such as pii, financial and secret. Heuristic detectors suggest labels at compile time and an operator promotes them. YAML policies deny or redact per caller and tenant, with log_only mode before you enforce.

statewave-admin / subjects
Statewave admin: Subjects list across all tenants
Statewave admin: Receipts page asking to pick a subject or tenant scope
Receipts load per subject or tenant. No cross-fleet listing
Statewave admin: Subjects list filtered to tenant default
Scoped per tenant
Use cases

AI agent memory
for the agents you ship.

Statewave provides AI agent memory for support desks, coding assistants, multi-agent systems and personal assistants, each keyed to the subject it serves.

All use cases →

Support agents

Your agent picks up each customer where the last session left off, with open issues, prior fixes and SLA status in one bundle.

Support agent workflow →
Handoff pack · account:northwind✓ Assembled
55 / 100
Health · watch
Open issue
Resend the May invoice
Prior fixes
Duplicate INV-2291 refunded · 9 Sep
Renewal moved to the 14th · 2 Sep
✓ First response 2m 25s1 resolution breach

Coding agents

Your assistant recalls architecture decisions and team conventions across sessions.

Coding agent memory →
statewave_get_context
Job queue uses Postgres advisory locks, not Redis.
← docs/adr/007.md
pnpm workspaces, Vitest, named exports.
← PR #212 review

Multi-agent systems

Agents share one memory per subject, and policies decide what each caller sees.

Read the policy docs →
account:northwind · as research-agent
Contact: █████ ████████pii · redacted

Personal assistants

Preferences and profile facts carry across sessions, and validity windows let stale facts expire.

See the domain model →
user:mira · profile_fact
Home airport: OAKactive
SFOsuperseded
valid 2025-04 → open
Integrations

One MCP server.
Connectors for your sources.

Statewave runs an MCP server for coding assistants and ships connectors that turn GitHub, Slack, Zendesk and other sources into episodes.

Your coding assistant, via MCP

Claude Code, Claude Desktop, Cursor, VS Code Copilot and Codex CLI are wired automatically by the quickstart. Windsurf, Cline, Continue, Zed, Aider, Goose and any other MCP client connect to the same server.

Set up the MCP server →
Statewave
Feeds memory from

GitHub, Slack, Zendesk, Jira, Notion, Intercom, Gmail and Discord on the outer ring.

All connectors →
Framework quickstartsLangChainCrewAIAutoGen
Self-hosted

Self-hosted on Postgres.
Runs next to your agent.

Statewave sits between your agent and your Postgres, with no telemetry path back to us. What leaves your network depends on the compiler you choose; the default one is fully local. See the data flow →

Your infrastructure
Your agentSDK or REST
Statewave:8100
PostgreSQL+ pgvector
Your LLM provideryour key, optional: the default compiler runs fully local
from statewave import StatewaveClient

with StatewaveClient("http://localhost:8100") as sw:
    sw.create_episode(
        subject_id="account:northwind",
        source="chat",
        type="conversation",
        payload={"messages": [
            {"role": "user", "content": "We moved our renewal to the 14th."},
        ]},
    )
    sw.compile_memories("account:northwind")

    bundle = sw.get_context(
        subject_id="account:northwind",
        task="When does our plan renew?",
        max_tokens=2000,
        emit_receipt=True,
    )
    print(bundle.assembled_context)
    print(bundle.receipt_id)
npx @statewavedev/statewave
curl -fsSL https://www.statewave.ai/install | sh
docker compose up -d
PostgreSQL 14+ with pgvector ≥ 0.4.2Python 3.11+CPU-only, no GPUDocker image linux/amd64 + arm64Docker Compose, Helm, Fly.io or Railway

Everything to build with Statewave

Getting started

Clone, run and ingest your first episode in about five minutes.

Read the quickstart →
API v1 contract

Every endpoint, the scoring model and webhook specs.

API reference →
Python SDK

Sync and async clients, Pydantic models, retry with backoff.

pip install statewave
TypeScript SDK

Fetch-based client with full type definitions.

npm install @statewavedev/sdk
Examples

Support agent, coding agent, LLM loop, eval suite, plus LangChain, CrewAI and AutoGen quickstarts.

statewave-examples →
Admin console

Operator console for subjects, memories, labels and receipts. Ships with the quickstart.

OpenRouter proxy

Give OpenRouter calls persistent memory: change the base URL, add one header.

OpenRouter proxy →
Changelog

Release notes for the server, SDKs and connectors.

Read the changelog →
Benchmarks

On par with Mem0's paid cloud
on Mem0's own harness.

Statewave's memory runtime scored on LoCoMo and LongMemEval with a fork of Mem0's harness, judge and scoring code unchanged.

LoCoMo · n = 1,540 · LLM-judge
0.905
Statewave
gpt-4o answerer and judge, Mem0's judge unchanged
0.899Mem0 cloud
0.866Mem0 OSS
0.800.901.00

Axis zoomed to 0.80–1.00 so the real separation is visible.

Three honest reads

01
A real lead, not a landslide
+0.039 over Mem0 OSS on 1,540 questions. 0.905 vs 0.899 against the paid tier is inside single-run noise.
02
Only the memory backend changes
A fork of Mem0's harness: same eval loop, judge and scoring code untouched from upstream.
03
Run against their best config
Three fixes to Mem0's own client code raise Mem0's scores, and all three are applied to their backends, not withheld.
LongMemEval
n = 30 · directional
0.967Statewave
0.933Mem0 cloud (paid)
0.833Mem0 open source
Single run · gpt-4.1 extraction · text-embedding-3-small · gpt-4o answerer and judgeMem0 OSS caps retrieval at ≤20 memories per query by library default, where Statewave and Mem0 cloud honor the harness's top-200 request.

Example receipt, signed.

Start in one command

Give your agent a memory
you can audit.

$ npx @statewavedev/statewave
Need an SLA or an architecture review? Talk to us →
FAQ

Frequently asked questions

Everything you need to know about Statewave.

What is Statewave?

Statewave is an open-source memory runtime for AI agents. It records raw events as immutable episodes, compiles them into typed semantic and episodic memories with provenance, and returns ranked, token-bounded context bundles that LLM applications can drop straight into a prompt.

What is AI memory infrastructure?

An AI memory runtime — sometimes called memory infrastructure — is the persistence layer between an LLM application and the long history of users, projects, and decisions it interacts with. Instead of bolting a vector database to a chat history, a memory runtime stores structured memories with confidence scores, validity windows, and provenance, then assembles them into deterministic context bundles for each new question.

How does Statewave give AI agents persistent memory?

Your application sends raw events (conversations, tool calls, decisions) to Statewave as episodes scoped to a subject — a user, account, agent, or project. A pluggable compiler turns those episodes into typed memories. When the agent needs to answer a new question, it asks Statewave for context; Statewave ranks the relevant memories and episodes by recency, similarity, kind priority, and temporal validity, then returns a ranked, token-bounded bundle ready for the LLM.

How is Statewave different from a vector database?

A vector database stores embeddings and returns nearest neighbours. Statewave is a memory runtime that uses a vector store (pgvector) underneath, but adds typed semantic and episodic memories, deterministic ranking with explainable signals, idempotent compilation, provenance back to source episodes, temporal validity windows, conflict resolution, and a token-bounded context-assembly step. It also persists raw episodes append-only so memory can be recompiled.

What's the difference between episodic and semantic memory in Statewave?

Episodic memories capture what happened — append-only event records of a conversation, tool call, or decision at a specific time. Semantic memories are typed facts compiled from episodes — profile facts, preferences, procedures, and episode summaries — with confidence scores and validity windows. Statewave returns both in the same context bundle so the agent has long-term knowledge and the recent timeline.