A general-purpose selective learning and memory substrate for LLM and Agent systems, featuring typed memories, revisable knowledge, and trust-aware retrieval.
Membrane provides structured memory governance for long-running agents, designed to replace traditional flat text logs and append-only context windows. At its core, the system establishes five typed memories (Episodic, Working, Semantic, Competence, Plan Graph), each with independent schemas and lifecycles. For knowledge management, it supports five explicit revision operations—Supersede, Fork, Contest, Retract, and Merge—while maintaining full audit trails. The system features an exponential time decay mechanism and background consolidation tasks that automatically distill episodic memories into semantic facts and solution graphs, enabling competence-based learning where agents improve over time. Security employs five-level sensitivity grading with caller trust-level filtering, combined with SQLCipher at-rest encryption and optional TLS in-transit protection. The architecture follows a decoupled three-layer design (Ingestion-Policy-Storage), backed by SQLite (default embedded) or Postgres+pgvector (for high concurrency and vector retrieval). A gRPC service with 15 methods supports standalone daemon deployment or Go library embedding, with TypeScript and Python client SDKs included. A built-in evaluation suite compares pure RAG against the full Membrane pipeline across retrieval quality and lifecycle scenarios. Four deployment tiers range from zero-infrastructure SQLite to full Postgres+pgvector+LLM semantic extraction, flexibly adapting to diverse requirements.