Skip to content
Open source · Self-hosted · Apache 2.0

AI memory built for production

Policies, sensitivity labels, and tamper-evident audit receipts — not just retrieval. Every memory traces to its source. Governance built in from day one.

708Unit tests56Eval assertions8/8Support workflow score2/8Naive approach score
View on GitHub

One command boots Statewave locally — API, admin console, and Postgres — and wires it into your MCP clients. No account, runs offline.

$npx @statewavedev/statewave
THE STATEWAVE APPROACH

Memory runtime for AI agents

Most AI applications have no memory. Every conversation starts from scratch. Context is lost between sessions. Statewave treats memory as a runtime — a durable layer any AI system can build on.

What is a memory runtime for AI agents?

A memory runtime is the persistence layer between an LLM application and everything it has seen — events, decisions, and prior sessions. It records raw events as immutable episodes, compiles them into typed memories with confidence scores, and retrieves ranked, token-bounded context bundles instead of a nearest-neighbor chunk pulled from a vector store.

How does memory compilation work?

Compilation is a background pass that reads new episodes and produces durable, typed memories — profile facts, preferences, prior-issue summaries — each linked back to its source episode. This split of raw events and durable facts mirrors the episodic/semantic memory taxonomy in the 2023 CoALA framework for language agents. Recompilation is idempotent — running it twice never creates duplicates.

Why isn't a bigger context window enough?

Stuffing full history into every prompt call raises cost and latency without fixing recall, and models still struggle with ordering and recency. According to Salesforce's CRMArena-Pro benchmark, agent task success drops from about 58% on single-turn tasks to about 35% on multi-turn ones, with lost context a leading cause. A memory runtime compacts history into ranked, retrievable facts instead of replaying it whole.

Ingest raw events as immutable episodes
Compile typed memories with confidence scores
Retrieve ranked, token-bounded context bundles
Trace every memory to its source with provenance
Organize everything around subjects — users, accounts, agents, repos
Memory runtime diagram: raw events compiled into a ranked context bundle
WHY EXISTING APPROACHES FAIL

Most AI memory systems fall short

Bolting on a vector database or dumping chat logs into a prompt creates fragile, unstructured context that degrades as it scales.

Prompt stuffing

  • Blows token budgets
  • No ranking or priority
  • Cost scales linearly with lifetime
  • No provenance

Naive RAG

  • Non-deterministic retrieval
  • No structured extraction
  • No temporal reasoning
  • No confidence scores

Raw history replay

  • Irrelevant noise
  • No memory compilation
  • Arbitrary truncation
  • No subject lifecycle
At a glance: each approach's key limitation, and what Statewave does instead.
ApproachKey limitation
Prompt stuffingBlows token budgets, no ranking or provenance
Naive RAGNon-deterministic retrieval, no temporal reasoning
Raw history replayArbitrary truncation, no memory compilation
StatewaveRanked, token-bounded, provenance-traced memory

Statewave builds durable, ranked, and structured memory.

BUILT FOR ANY STATEFUL AI WORKFLOW

Stateful memory for every kind of AI agent

Statewave is a runtime — not a vertical product. Any AI system that needs to remember across sessions can build on it.

Statewave workflow map

Support agents

Primary wedge

Session-aware context, resolution tracking, handoff packs, health scoring, SLA monitoring, repeat-issue detection. The first and most proven workflow.

Coding agents

Supported

Accumulate project knowledge across sessions — tech stack, architecture decisions, preferences. Your agent builds understanding over time.

Internal copilots

Supported

Give internal tools persistent memory of user workflows, past decisions, and organizational context. Every interaction builds on the last.

Long-lived agent systems

Supported

Any AI system that operates over time, across sessions, with subjects that have persistent identity. Statewave is the memory layer.

AI CLIENTS & AGENTS

Works with the tools you already use

One quickstart command auto-detects and wires every installed AI tool. Any MCP-compatible client works — not just the ones we list here.

Claude Code

Auto-configures via MCP server

Claude Desktop

Auto-configures via MCP server

Cursor

Auto-configures via MCP server

VS Code Copilot

Auto-configures via MCP server

Codex CLI

Auto-configures via MCP server

Cline

Any MCP-compatible client

Continue

Any MCP-compatible client

Windsurf

Any MCP-compatible client

Zed

Any MCP-compatible client

Aider

Any MCP-compatible client

Goose

Any MCP-compatible client

Your own agent

REST API · Python · TypeScript

Missing your tool? Open an issue →

WHAT SETS STATEWAVE APART

Memory with governance built in

Retrieval is a solved problem. Production AI needs policies, an audit trail, and data boundaries — not just fast lookup. Statewave is built for that from the ground up.

The stakes are real: the EU AI Act became applicable on 2 August 2026, and high-risk AI systems face logging and traceability obligations from 2 December 2027 — governance built in from day one is the difference between meeting that bar and retrofitting it under deadline.

Sensitivity labels

Tag memories as pii, financial, or secret. Auto-detected at ingest, operator-reviewed before promotion. Labels travel with the memory forever.

Declarative policies

YAML policies gate access by caller identity. Deny or redact sensitive memories per tenant. log_only mode for audit before enforcement.

State-assembly receipts

Every context call produces an immutable, ULID-addressable receipt with a byte-level integrity hash. Replay any call. Prove exactly what the agent saw.

Full provenance

Every compiled memory carries a chain back to its source episodes. Your agent can show its work — which conversations, commits, or documents produced each fact.

Multi-tenant isolation

Subject-scoped architecture with app-layer query isolation. One instance serves many tenants without cross-tenant data leakage — by design, not by convention.

GDPR-ready erasure

Subject deletion removes all episodes, memories, and receipts for a given subject in one call. No orphaned data, no manual cleanup.

CONNECTORS & INTEGRATIONS

Not just live chats —
connect your tools

Connectors feed real-world events into Statewave as durable episodic memory. Agents recall projects, customers, communities, decisions, and workflows — by subject — without stuffing raw history into a prompt.

Modular packages — install only what you need. The core stays clean; connectors are optional.

SUPPORT AGENT WORKFLOW

Proven first in support-agent workflows

Support agents are the first workflow where Statewave is deeply optimized and rigorously evaluated — the clearest proof that structured memory outperforms naive approaches.

01

Session-aware context

Active sessions boosted, resolved issues deprioritized. Context is ranked by what matters right now.

02

Handoff context packs

Compact escalation briefs with health, SLA, and issue context — ready for human or AI handoff.

03

Health scoring

Deterministic 0–100 health scores with explainable factors. Proactive webhook alerts on degradation.

04

Resolution tracking

Track issue state per session. Surface resolution history when recurring patterns are detected.

05

SLA tracking

First-response time, resolution time, breach detection. Integrated into health scoring and handoff.

06

Repeat-issue detection

Automatically surface prior resolutions when recurring problems appear. Stop solving the same issue twice.

HOW IT WORKS

Core capabilities

Production-ready primitives for any AI system that needs persistent, structured memory.

01

Ingest

Capture raw truth

Append-only episodes with immutable, token-bounded context. No overwrites, no ambiguity.

02

Compile

Structure & enrich

Pluggable compilers turn raw episodes into ranked memory with heuristics or LLMs. Recompilation is idempotent — safe to re-run, never duplicates.

03

Govern

Trust & control

Provenance for every memory, policy enforcement, state receipts, and audit-ready integrity.

04

Deliver

Serve & integrate

Semantic search, SDKs, webhooks, and OpenTelemetry for reliable delivery at scale.

05

Isolate

Secure by default

Multi-tenant isolation, per-tenant configuration, and subject-level deletion for compliance.

Conflict resolution

Auto-supersedes older overlapping memories

Idempotent compilation

Safe recompilation, no duplicates

Typed SDKs

Python (async + sync) & TypeScript

State receipts

ULID-addressable audit records with byte-level integrity

Webhooks

Persistent delivery with retry + dead-letter

Semantic search

pgvector cosine similarity + text fallback

VERIFIED BY EVALS

Proven, not promised

Every claim is backed by automated evals and benchmarks that run in CI. Statewave scores 8/8 on support workflow criteria where naive approaches score 2/8.

708

Unit tests

56

Eval assertions

8/8

Support workflow score

2/8

Naive approach score

What the evals prove

Identity facts persist across sessions
Relevant preferences surface for matching tasks
Token budgets are always respected
Provenance traces facts to source episodes
Compilation is idempotent — no duplicates
Session-aware ranking boosts active sessions
Repeat-issue detection surfaces prior fixes
Health scoring is deterministic and explainable
DEPLOY YOUR WAY

Self-hosted. Framework-neutral.

Run Statewave alongside any AI application. The storage layer is Postgres-only and runs in your infrastructure — no Statewave-managed cloud sees your episodes or memories.

What leaves your network depends on the compiler and embedding you configure. The default heuristic compiler is fully local; choosing the LLM compiler or a hosted embedding model sends content to that provider. See the data-flow breakdown →

One command — installs, wires MCP clients, seeds repos

$ npx @statewavedev/statewave

Verify the server is up

$ curl http://localhost:8100/healthz
# → {"status":"ok"}

Tear down when done

$ npx @statewavedev/statewave --down

Runs in demo mode by default — add an LLM key for semantic search. Docs → · Source →

GOT QUESTIONS?

Frequently asked questions

Honest, technical answers about Statewave, AI agent memory, and how it fits with the rest of your stack.

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.

Can Statewave be self-hosted?

Yes. Statewave is designed to be self-hosted. The storage layer is Postgres-only with the pgvector extension. A Docker Compose setup runs the full stack locally in two minutes; production deployments target Fly.io, Railway, or any container platform. There is no managed Statewave cloud — episodes and compiled memories stay in your infrastructure.

Is Statewave open source? What about commercial use?

Yes. Statewave is open source under the Apache License 2.0 — server, Python and TypeScript SDKs, connectors, and this site. Apache-2.0 is permissive and includes an explicit patent grant, so you can use, modify, distribute, self-host, and build proprietary or commercial products with Statewave without a separate agreement. Optional enterprise support — SLA, indemnity, procurement, managed hosting, architecture review — is available as a services contract: contact licensing@statewave.ai.

Which LLM providers and frameworks does Statewave work with?

Statewave is framework-neutral. Compilation goes through LiteLLM, which supports 100+ providers including OpenAI, Anthropic, Azure OpenAI, AWS Bedrock, Google Vertex, Mistral, Groq, Together, and locally hosted models via Ollama or vLLM. The retrieval and context-assembly layer is provider-agnostic — your agent calls Statewave for context, then calls whatever LLM it likes. Python and TypeScript SDKs make integration with custom agents, copilots, and assistant frameworks straightforward.

Can I use Statewave with Copilot, MCP servers, or LangChain-style agents?

Yes — anywhere your agent can make an HTTP call, it can call Statewave. The REST API and SDKs return ranked context bundles ready to splice into a system prompt, a tool result, or a retrieval-augmented chain. There is nothing framework-specific to install on the agent side; you decide where the context goes in your prompt.

What does Statewave run on?

Statewave runs as a Python service backed by Postgres with the pgvector extension. The default deployment is a single container plus a Postgres instance, orchestrated via Docker Compose. OpenTelemetry instrumentation is optional. Embeddings can be hosted (OpenAI, Cohere) or fully local (Ollama, sentence-transformers); the heuristic compiler runs entirely without an LLM if you want a fully local pipeline.

More questions? Read the docs, browse the use cases, see the full FAQ, or open an issue on GitHub.
START BUILDING

Give your AI system memory

Start building with Statewave in about 5 minutes. Self-hosted, open source, and proven.

Get StartedGitHub