What is Membrane?
Membrane gives long-lived LLM agents structured, revisable memory with built-in decay, trust-gated retrieval, and audit trails. Instead of an append-only context window or flat text log, agents get typed memory records that can be consolidated, revised, contested, and pruned over time. Most LLM/agent “memory” is either ephemeral (context windows that reset each turn) or an append-only text log stuffed into a RAG pipeline. That gives you retrieval, but not learning: facts get stale, procedures drift, and the system cannot revise itself safely. Membrane makes memory selective and revisable. It captures raw experience, promotes it into structured knowledge, and lets you supersede, fork, contest, or retract that knowledge with evidence. The result is an agent that can improve over time while remaining predictable, auditable, and safe.Mental model
Consolidate
Background jobs promote episodic traces into semantic facts, competence records, and plan graphs.
Retrieve
Query memory in layers with trust gating and salience ranking — agents only see what they’re allowed to see.
Revise
Update knowledge with explicit operations (supersede, fork, merge, contest, retract) and a full audit trail.
Key features
Typed memory
Five distinct memory types (episodic, working, semantic, competence, plan_graph) with explicit schemas and lifecycle rules — not a flat text store.
Revisable knowledge
Supersede, fork, retract, merge, and contest records with full provenance tracking and audit trails.
Competence learning
Agents learn how to solve problems — procedures with success rate tracking — not just what happened.
Trust-aware retrieval
Sensitivity levels (public, low, medium, high, hyper) with graduated access control and redacted responses.
Decay and consolidation
Time-based salience decay keeps memory useful; background consolidation extracts structured knowledge from raw experience.
Vector-aware retrieval
With Postgres + pgvector, competence and plan-graph applicability are scored with embedding similarity.
gRPC API
15-method gRPC service with TypeScript and Python client SDKs, or use Membrane as an embedded Go library.
Security and operations
SQLCipher encryption at rest, optional TLS, API key authentication, configurable rate limiting, full audit logs.
Deployment tiers
Membrane scales from a zero-infrastructure SQLite default to a full Postgres + pgvector + LLM pipeline:| Tier | Backend | Embedding | LLM | Behavior |
|---|---|---|---|---|
| 1 | SQLite | — | — | Zero-infra default, confidence-based applicability fallback |
| 2 | Postgres | — | — | Concurrent writers, JSONB storage, same retrieval semantics as tier 1 |
| 3 | Postgres + pgvector | Yes | — | Embedding-based applicability scoring for competence and plan_graph selection |
| 4 | Postgres + pgvector | Yes | Yes | Full system with LLM-backed episodic to semantic extraction |
Get started
Quickstart
Build and run Membrane in under 5 minutes.
Architecture
Understand how the subsystems fit together.
Memory types
Learn the five memory types and their lifecycle rules.
Go library
Embed Membrane directly in your Go application.