
Write HTML. Render video. Built for agents.
Membrane adds persistent, structured memory to agent workflows. It uses typed records, entity links, retrieval, revision, decay, and access policy so an agent can remember what happened, correct stale facts, and bring back the right context later.
Builders who want their agents to carry context across sessions and update knowledge as work changes.
You can give an agent memory that stays useful, editable, and retrieval-aware instead of re-explaining everything each session.
Stores episodic, working, semantic, competence, plan, and entity memories as separate record types.
Lets you supersede stale facts, contest claims, fork alternatives, or retract records while keeping audit history.
Changes what is remembered over time based on reinforcement, decay, and consolidation.
Applies scope and sensitivity rules so reads and writes follow policy and restricted responses are redacted.
Use Membrane as an embedded Go package or as a gRPC service running as `membraned`.
Includes OpenClaw plugin support and TypeScript and Python SDKs for connecting other agent setups.
Memory that agents can connect, revise, and learn from.
Documentation · Quickstart · Architecture · API reference
Membrane gives LLM agents persistent, structured memory. An agent can remember what happened, connect it to existing knowledge, retrieve the context a task needs, and correct that knowledge when circumstances change.
Use it for agents that carry work across sessions, maintain changing facts, reuse successful procedures, or need to explain which memories informed an answer.
flowchart LR
Experience["Events, observations<br/>and task state"] --> Memory["Typed memory<br/>+ entity links"]
Memory --> Context["Relevant context<br/>within access limits"]
Context --> Agent["Agent acts"]
Agent -->|"New evidence and outcomes"| Memory
Five memory layers, connected by entities:
| Memory | The question it answers | Example |
|---|---|---|
| Episodic | What happened? | An incident, a tool result, an observation |
| Working | What are we doing now? | The current goal, next action, open questions |
| Semantic | What do we know? | A preference, a system fact, a relationship |
| Competence | What has worked before? | A debugging procedure and its success history |
| Plan graph | How should this work unfold? | A rollout with dependencies and checkpoints |
| Entity | What is this about? | The same service, project, file, or person across memories |
| Use Membrane from… | Connection | Start here |
|---|---|---|
| Go | Embed the library in your process | Go guide · Package reference |
| TypeScript / JavaScript | Connect to the gRPC daemon | SDK and examples |
| Python | Connect to the gRPC daemon | SDK and examples |
| OpenClaw | Add memory tools and context through the plugin | Plugin setup |
| Another language | Use the protobuf service contract | gRPC API |
For a complete agent loop, see the agent harness. It exercises capture, graph retrieval, revisions, and access controls against a running daemon, with both deterministic and optional live-model scenarios.
[!IMPORTANT] PostgreSQL with pgvector is required, whether you embed the Go library or run the daemon. Embedding and LLM providers are optional: structured capture, graph retrieval, revisions, and access controls work without a model API key.
Use the Go toolchain declared in go.mod. From a fresh checkout:
git clone https://github.com/BennettSchwartz/membrane.git
cd membrane
make build
export MEMBRANE_POSTGRES_PASSWORD="$(openssl rand -hex 24)"
export MEMBRANE_POSTGRES_DSN="postgres://membrane:${MEMBRANE_POSTGRES_PASSWORD}@127.0.0.1:5432/membrane_test?sslmode=disable"
docker compose up -d
until docker compose exec -T postgres pg_isready -U membrane -d membrane_test; do sleep 1; done
./bin/membraned --postgres-dsn "$MEMBRANE_POSTGRES_DSN"
The daemon applies its database schema on startup and listens on
127.0.0.1:9090. Its default policy permits the default scope at LOW sensitivity.
See configuration for scopes, provider settings,
TLS, and authentication.
The TypeScript and Python quickstarts connect to this daemon.
| Setup | What it enables |
|---|---|
| PostgreSQL + pgvector | Typed records, entity links, bounded retrieval, revisions, and salience |
| + Embedding provider | Automatic vector population and hybrid vector/salience ranking |
| + LLM provider | Optional interpretation during capture and semantic extraction during consolidation |
Full quickstart · Deployment guide · Security guide
| I want to… | Read |
|---|---|
| Understand the design | Architecture · Specification |
| Configure a deployment | Configuration · Deployment |
| Understand retrieval and revision | Retrieval · Revision |
| Inspect behavior and limitations | Observability · Trust and sensitivity |
| Change the code | Contributing · Core packages · Integration and evaluation tests |
Go uses the toolchain in go.mod. The TypeScript SDK and examples need Node.js 20.19+, the docs toolchain needs Node.js 22+, and the Python SDK needs Python 3.10+.
| Command | What it checks |
|---|---|
make build | Build the daemon |
make test | Run Go tests |
make verify | Check storage/protobuf/package contracts, SDKs, harness tools, and the docs build |
make lint | Run Go vet and Staticcheck |
make agent-harness-deterministic | Exercise an agent scenario against PostgreSQL |
Set disposable PostgreSQL DSNs to include database integration tests. Provider credentials enable live embedding and model evaluations. See CONTRIBUTING.md and the harness guide.
Bug reports, integration feedback, and contributions are welcome. Open an issue or read the contribution guide.
MIT licensed. See LICENSE.
Sign in to join the discussion.
No comments yet. Be the first to say what this is good for.

Write HTML. Render video. Built for agents.
Ultra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps
SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

Omnigent is an open-source AI agent framework and meta-harness: orchestrate Claude Code, Codex, Cursor, Pi, and custom agents — swap harnesses without rewriting, enforce policies and sandboxing, and collaborate in real time from any device.
A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!