I'm making a self-improving agent for OpenClaw. Would it be better to connect it via a skill/ plugin here are the details. it can connect via a typescript client: 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.
60-Second Mental Model
Ingest events, tool outputs, observations, and working state.
Consolidate episodic traces into semantic facts, competence records, and plan graphs.
Retrieve in layers with trust gating and salience ranking.
Revise knowledge with explicit operations and audit trails.
Decay salience over time unless reinforced by success.
Key Features
Typed Memory -- Explicit schemas and lifecycles for each memory type, not a flat text store.
Revisable Knowledge -- Supersede, fork, retract, merge, and contest records with full provenance tracking.
Competence Learning -- Agents learn how to solve problems (procedures, success rates), not just what happened.
Decay and Consolidation -- Time-based salience decay keeps memory useful; background consolidation extracts durable knowledge from episodic traces.
Trust-Aware Retrieval -- Sensitivity levels (public, low, medium, high, hyper) with graduated access control and redacted responses for records above the caller's trust level.
Security and Operations -- SQLCipher encryption at rest, optional TLS and API key authentication, configurable rate limiting, full audit logs.
Observability -- Built-in metrics for retrieval usefulness, competence success rate, plan reuse frequency, memory growth, and revision rate.
gRPC API -- 15-method gRPC service with TypeScript and Python client SDKs, or use Membrane as an embedded Go library.
LLM-Ready Context Retrieval -- Retrieve trust-filtered, typed memory and inject it directly into LLM prompts for planning, execution, and self-correction loops.
Memory Types
Type Purpose Example
Episodic Raw experience capture (immutable) Tool calls, errors, observations from a debugging session
Working Current task state "Backend initialized, frontend pending, docs TODO"
Semantic Stable facts and preferences "User prefers Go for backend services"
Competence Learned procedures with success tracking "To fix linker cache error: clear cache, rebuild with flags"
Plan Graph Reusable solution structures as directed graphs Multi-step project setup workflow with dependencies and checkpoints
Each memory type has its own schema, lifecycle rules, and consolidation behavior. Episodic records are immutable once ingested. Working memory tracks in-flight task state. Semantic, competence, and plan graph records are the durable output of consolidation and can be revised through explicit operations.