Statewave Agent Memory Runtime
A self-hosted memory runtime that gives AI agents reproducible, provenance-tagged context instead of noisy query-time retrieval.
- Source repo
- smaramwbc/statewave
- Stars
- ★ 259
- Last updated
- 1mo ago v1.5.0
- FARS reviewed
- Nov 08, 2026
- License
- Apache-2.0
- Primary language
- Python
- FA score
- 72/100 · Some gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI API · Claude APIClaude Code (Partial support)
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Support teams that need returning customers recognised across sessions, ranked context inside a token budget, and a handoff pack via POST /v1/handoff when a case escalates.
- Not a fit if
- Multi-replica teams unwilling to switch to Postgres-backed rate limiting
- Teams that want built-in auth that issues API keys and admin identities
- Teams doing mostly single-hop lookups and optimising hard for token cost
- Website
- statewave.ai ↗ set on GitHub
- Maintenance
- Commits in the last 6 monthslast commit 2026-10-24latest release v1.5.0 (2026-08-30)
- Source review
- 72/100 · Some gaps
What does this agent do, and when should you use it?
Statewave is an open-source memory runtime for AI agents, self-hosted on Postgres + pgvector, built around a compile-then-use model rather than per-query similarity search. It records append-only episodes per subject (user:, repo:, account:, or any prefix), compiles them into typed memories with confidence scores and provenance using either a fully local heuristic compiler or an LLM compiler, then assembles ranked, token-bounded context bundles for a given task. Every bundle comes with an immutable state-assembly receipt that traces back to source episodes, supports HMAC-SHA256 signing and POST /v1/receipts/{id}/replay. The server runs on port 8100 behind a REST API with a full OpenAPI surface, and ships Python (pip install statewave) and TypeScript (npm install @statewavedev/sdk) SDKs. It boots in demo mode with stub embeddings and the heuristic compiler, so no LLM key or GPU is needed to start; enabling semantic search and stronger extraction means pointing LiteLLM at any of 100+ providers.
The runtime is organised around subjects, and the end-to-end loop is ingest → compile → use. Ingestion uses POST /v1/episodes or POST /v1/episodes/batch (up to 100 at a time) to append raw events. Compilation calls POST /v1/memories/compile, which extracts typed, summarised memories with confidence scores and provenance, and is idempotent so recompiling produces no duplicates. Retrieval calls POST /v1/context to assemble a ranked, token-bounded bundle for a named task; the same query against the same subject at the same point in time yields the same bytes. Governance endpoints include GET /v1/timeline, GET /v1/subjects, DELETE /v1/subjects/{id} for subject-level deletion, POST /v1/handoff for a compact handoff pack, plus GET /v1/subjects/{id}/health for an explainable health score and /sla for response and resolution metrics. Search is served by GET /v1/memories/search across kind, text or semantic similarity, and POST /v1/resolutions tracks issue state per session. Compliance features include a declarative YAML policy engine (deny / redact) over memory tags such as pii, financial and secret, v0.9 heuristic auto-labeling with suggested_labels and operator promotion, multi-tenant isolation via the X-Tenant-ID header, and per-tenant region pinning that returns HTTP 403 residency.mismatch to processes in the wrong region.
- Support teams that need returning customers recognised across sessions, ranked context inside a token budget, and a handoff pack via POST /v1/handoff when a case escalates.
- Long-running coding agents that persist project memory — tech stack, preferences and architecture decisions — across separate conversations under a repo: subject.
- Platform teams that want to self-host memory on their own Postgres and wire any language or framework to it over the REST API, keeping data inside their network.
- Compliance and risk teams that need deny/redact policies over pii, financial and secret tags plus signed receipts showing which memories influenced each assembled bundle.
- Organisations with data-residency rules that pin tenants to a region so requests hitting the wrong region are refused outright.
- Teams building memory from non-chat sources by syncing GitHub, Slack, Notion, Zendesk or Gmail events into episodes with the @statewavedev/connectors-* packages, dry-run first.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
npx @statewavedev/statewavecurl -fsSL https://www.statewave.ai/install | shirm https://www.statewave.ai/install.ps1 | iexdocker compose up -d
- Ports
8100- Environment variables
STATEWAVE_LITELLM_API_KEYSTATEWAVE_LITELLM_MODELSTATEWAVE_LITELLM_EMBEDDING_MODEL- Config files
.envdocker-compose.yml- Runtime
- Python 3.11+
- Install notes cover
- Windows · macOS · Linux · Docker
How do you install or deploy this agent?
The fastest path is the official install script or npx; you can also run it yourself with Docker Compose.
# macOS / Linux
npx @statewavedev/statewave
# or
curl -fsSL https://www.statewave.ai/install | sh# Windows (PowerShell)
irm https://www.statewave.ai/install.ps1 | iexSelf-managed install:
git clone https://github.com/smaramwbc/statewave && cd statewave
docker compose up -dThis brings up Postgres (with pgvector) plus the API; migrations run on container start and the API is served at http://localhost:8100. The default is demo mode (stub embeddings + heuristic compiler). For LLM-backed behaviour, place a .env next to docker-compose.yml and re-run docker compose up -d:
STATEWAVE_EMBEDDING_PROVIDER=litellm
STATEWAVE_LITELLM_API_KEY=sk-... # any LiteLLM provider
STATEWAVE_LITELLM_MODEL=gpt-4o-mini
STATEWAVE_LITELLM_EMBEDDING_MODEL=text-embedding-3-smallRequirements: PostgreSQL 14+ with pgvector ≥ 0.4.2; SDKs need Python 3.11+ or Node.js.
How do you use this agent?
Check readiness, then run the ingest → compile → use loop from the SDK or over HTTP.
curl http://localhost:8100/readyz
curl http://localhost:8100/healthzfrom statewave import StatewaveClient
with StatewaveClient("http://localhost:8100") as sw:
sw.create_episode(subject_id="user-42", source="chat", type="message",
payload={"text": "Alice asked about pricing tiers"})
sw.compile_memories("user-42")
print(sw.get_context("user-42", task="answer pricing", max_tokens=1000).assembled_context)Interactive API docs live at http://localhost:8100/docs (Swagger) and /redoc. Key endpoints: POST /v1/episodes, POST /v1/memories/compile, POST /v1/context, GET /v1/timeline, GET /v1/subjects, DELETE /v1/subjects/{id}. Connector example (dry-run by default, nothing is ingested):
statewave-connectors sync github \
--repo smaramwbc/statewave \
--subject repo:smaramwbc/statewave \
--dry-runSafety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
Inherits capabilities of connected MCP servers; audit third-party servers before enabling.
What are this agent's strengths and limitations?
- Deterministic context: the same subject, task and point in time always yield the same bundle bytes, backed by state-assembly receipts with HMAC-SHA256 signing and a replay endpoint
- Compile-once design instead of query-time retrieval, producing typed memories with confidence scores and provenance and avoiding sampling noise
- Fully self-hosted on Postgres + pgvector; the default heuristic compiler and stub embeddings run locally and the API process is CPU-only, so no GPU is required
- Provider-neutral via LiteLLM (100+ model and embedding providers) with both Python and TypeScript SDKs covering sync and async usage
- Built-in sensitivity labels with a YAML deny/redact policy engine, multi-tenant isolation, and tenant region pinning for residency-sensitive deployments
- You must run and operate PostgreSQL 14+ with pgvector ≥ 0.4.2 yourself; there is no vendor cloud as the primary path
- Auth is limited to validating API keys you configure — it does not issue them, admin action identity (promoted_by) is still null, and multi-tenancy is app-layer without Postgres RLS
- Rate limiting defaults to per-process and per-IP; multi-replica deployments must switch to STATEWAVE_RATE_LIMIT_STRATEGY=distributed and there is no per-tenant or per-API-key limiting yet
- v1.5.0 is actively developed: receipt replay is current code plus original policy rather than byte-for-byte history, and federated cross-region audit plus a visual policy editor are still pending
- Compiled bundles are denser than fact-store retrieval, so per-answer token cost is higher and a lighter fact store may be the better call for mostly single-hop queries
How does this agent compare with similar options?
The README contrasts Statewave with two alternatives: memory layers that store isolated facts and retrieve them per query (or extract a graph whose retrieval surface can return the same summary regardless of the question), and bolting a vector database or raw chat logs onto a prompt. It also states explicitly that it is not a chatbot framework, vector database, RAG pipeline, or hosted service.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Statewave Agent Memory Runtime This agent | 72 · Some gaps | Self-hosted serviceFree + model costs | ★ 259 | 1mo ago | Python | OpenAI API · Claude API |
| MATE — Command Center for AI Agents | 72 · Some gaps | Self-hosted serviceFree + model costs | ★ 111 | today | Python | OpenAI API · Claude API |
| DuraGraph | 50 · Major gaps | CLIFree | ★ 146 | 2mo ago | Go | — |
| Agent Barn | 72 · Some gaps | Self-hosted serviceFree + model costs | ★ 112 | 1d ago | Python | — |
How does FollowAgents rate this agent?
Why each dimension lost points
The evidence describes self-hosting, API keys, tenant isolation, policies, sensitivity labels, region restrictions, and signed receipts. SECURITY.md also describes dependency and code scanning, supporting moderate to strong scores for least privilege, sensitive-data handling, and dependency security; however, some controls are asserted rather than demonstrated, and the documented defaults include an empty API key and wildcard CORS. Connector sync examples use dry-run and describe opt-in behavior, but the permanent subject-delete endpoint has no demonstrated confirmation or recovery safeguard, so confirmation and rollback score low. Provenance and data-flow documentation are linked, and optional LLM, embedding, and webhook paths are configurable, though their implementation details are outside the sample. Source traceability and a vulnerability-reporting contact are documented, but publisher identity and maintenance ownership remain unclear.
The CI definition includes a Python version matrix, lockfile check, migrations, unit and integration tests, and a container health probe. The app also checks schema compatibility and logs background-task failures. This supports ordinary reliability, but this static review does not claim to have run tests, and the sample cannot establish full consistency across documentation, lockfiles, and implementation. Dependencies have version ranges and a lockfile workflow; Postgres, optional LLM providers, and other services remain availability requirements. Readiness checks and missing-key messages help, though some startup failures are caught and the server continues, so error handling is not comprehensive.
The README identifies developers as the audience, gives support and coding-agent scenarios, and clearly says the product is a memory runtime rather than a chatbot framework, vector database, or hosted service. Connector examples show how to invoke some capabilities, but connectors live in an external repository and their trigger details cannot be verified here. Support for Python 3.11–3.13, multi-architecture Docker, Postgres, REST, two SDKs, heuristic or LiteLLM compilers, and local/self-hosted deployment provides strong environment-fit evidence.
The README organizes capabilities, deployment, API, configuration, limitations, and documentation clearly, though it is long and documentation spans repositories. Installation instructions cover npx, Docker, PowerShell, configuration, and tests; examples and FAQ are concrete, and limitations include the lack of RLS, admin identity, federated audit, and historical snapshots. Apache-2.0 is consistent across metadata, README, and license file. Version 1.5.0, an external changelog and roadmap, and CI version-consistency checks are referenced, but the changelog itself is not in the sample. SECURITY.md and contributor guidance provide reporting and maintenance pathways, while publisher identity and ongoing ownership are not verified.
The product assembles ranked, token-bounded context bundles with provenance and offers timelines, receipts, and deletion, making its outputs directly usable in prompts. The claimed value over query-time retrieval and benchmark advantage are primarily README assertions, so marginal value receives a moderate score. The README acknowledges higher token use per answer and suggests lighter fact stores for cost-sensitive, mostly single-hop workloads. Local heuristic and stub modes can reduce external costs, but the net benefit depends on the workload.
The README links to specific endpoint, configuration, limitation, and architecture references; pyproject metadata, CI, app startup code, and the license provide partial cross-source corroboration. Key documents and connector implementations are outside the supplied sample, so they cannot be checked. CI and test helper files are evidence of a test setup, not evidence that tests were executed or independently verified here. The documentation distinguishes demo behavior and describes current limitations, but performance and multi-hop accuracy remain largely product claims, short of the evidence needed for full marks.
- STATEWAVE_API_KEY defaults to empty and CORS_ORIGINS to a wildcard; configure authentication and restrict allowed origins before deployment.
- Deleting a subject permanently removes its data; the sample shows no confirmation or recovery mechanism, so verify backups and deletion behavior first.
- LLM, embedding, and webhook integrations can send data to configured external services; review data flows and provider settings before deployment.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
Release notes excerpt
What's Changed * chore(deps): update ruff requirement from <1,>=0.15.20 to >=0.15.21,<1 by @dependabot[bot] in https://github.com/smaramwbc/statewave/pull/288 * chore(deps): update fastapi requirement from <1,>=0.139.0 to >=0.139.1,<1 by @dependabot[bot] in https://github.com/smaramwbc/statewave/pull/289 * chore(deps): update litellm requirement from <2,>=1.91.1 to >=1.92.0,<2 by @dependabot[bot] in https://github.com/smaramwbc/statewave/pull/290 * docs: static Docker badge (avoid shields.io upstream rate-limit) by @smaramwbc in https://github.com/smaramwbc/statewave/pull/291 …View on GitHub ↗ -
Release notes excerpt
What's Changed * fix(admin): harden bulk delete matching by @skarL007 in https://github.com/smaramwbc/statewave/pull/268 * chore(deps): update litellm requirement from <2,>=1.89.2 to >=1.89.4,<2 by @dependabot[bot] in https://github.com/smaramwbc/statewave/pull/261 * chore(deps): update opentelemetry-api requirement from <2,>=1.42.1 to >=1.43.0,<2 by @dependabot[bot] in https://github.com/smaramwbc/statewave/pull/263 * chore(deps): update opentelemetry-exporter-otlp requirement from <2,>=1.42.1 to >=1.43.0,<2 by @dependabot[bot] in https://github.com/smaramwbc/statewave/pull/267 …View on GitHub ↗ -
Release notes excerpt
What's Changed * chore(deps): bump starlette from 1.0.1 to 1.3.1 by @dependabot[bot] in https://github.com/smaramwbc/statewave/pull/248 * chore(deps): bump aiohttp from 3.14.0 to 3.14.1 by @dependabot[bot] in https://github.com/smaramwbc/statewave/pull/249 * fix(tests): isolate test runs from the repo .env by @smaramwbc in https://github.com/smaramwbc/statewave/pull/250 * feat(llm): return token usage + model from /v1/llm/complete by @smaramwbc in https://github.com/smaramwbc/statewave/pull/251 …View on GitHub ↗
FAQ
Can I run it without paying for an LLM API?
Do I need a GPU or Kubernetes?
Why does a context bundle cost more tokens than a plain fact store?
What breaks at multi-replica scale?
Can I use it commercially in a closed-source product?
Which port does Statewave Agent Memory Runtime use?
Does Statewave Agent Memory Runtime work on Windows?
irm https://www.statewave.ai/install.ps1 | iex.Is Statewave Agent Memory Runtime open source?
Is Statewave Agent Memory Runtime safe to use?
Is Statewave Agent Memory Runtime still maintained?
Who makes Statewave Agent Memory Runtime?
What is Statewave Agent Memory Runtime's official website?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.