smaramwbc/statewave
Open-source memory runtime for AI agents — reproducible, provenance-tagged context bundles instead of query-time retrieval. Apache-2.0, self-hosted on Postgres + pgvector, Python + TypeScript SDKs.
What it solves
Statewave provides a durable, structured memory runtime for AI agents to prevent the loss of context between sessions. It replaces fragile, unstructured prompt-stuffing or simple vector database retrieval with a deterministic system that ensures agents remember preferences, decisions, and history across different conversations.
How it works
Statewave operates as infrastructure that runs alongside an application using a "compile-then-use" approach:
- Ingest: Raw events (episodes) are recorded in an append-only format.
- Compile: These episodes are processed into typed, summarized memories with confidence scores and provenance.
- Retrieve: The system assembles ranked, token-bounded context bundles for prompts on demand.
- Govern: It allows for the inspection of subject timelines and the deletion of data by subject.
This process is idempotent, meaning the same query against the same subject at the same point in time always produces the same result, eliminating the sampling noise common in query-time retrieval.
Who it’s for
Developers building AI agents (such as customer support or long-running coding agents) who need their systems to remember user-specific data and architectural decisions across multiple sessions without being locked into a specific chatbot framework.
Highlights
- Provenance: Every memory can be traced back to its original source episode via content-hashed receipts.
- Deterministic Context: Provides token-bounded bundles that are consistent per subject and task.
- Pluggable Compilers: Supports both local heuristic compilers (regex) and LLM-based compilers via LiteLLM.
- Self-Hosted: Runs on Postgres and pgvector, ensuring the user owns the storage and avoiding vendor lock-in.
- Multi-tenant Support: Includes query-scoped data isolation and region pinning for data residency.
- Framework Neutral: Integrates via REST API or SDKs with any AI stack, including LangChain, CrewAI, and AutoGen.
Related
- Project
- Project
- Project
- Project
- Project