Engram Brain
by @moshik21
Persistent long-term memory powered by knowledge graphs, ACT-R activation, and 15-phase consolidation. Remember conversations across sessions, recall relevan...
clawhub install engram-brainπ About This Skill
name: engram-brain description: Persistent long-term memory powered by knowledge graphs, ACT-R activation, and 15-phase consolidation. Remember conversations across sessions, recall relevant context automatically, and build a private brain that improves over time. Zero LLM cost by default. version: 0.3.1 license: Apache-2.0 user-invocable: true metadata: openclaw: requires: env: [] anyBins: - docker - uv optionalEnv: - ANTHROPIC_API_KEY - ENGRAM_GROUP_ID emoji: "\U0001F9E0" homepage: https://github.com/Moshik21/engram install: uv: engram tags: - memory - knowledge-graph - mcp - recall - long-term-memory - cognitive-architecture
Engram Memory
You have access to Engram, a persistent memory system that builds a temporal knowledge graph from conversations. It uses ACT-R cognitive architecture for activation-aware retrieval and runs offline consolidation inspired by biological memory.
Works with both lite (SQLite) and full (HelixDB Docker) Engram installs. Zero LLM cost by default β all consolidation scoring, replay, and retrieval are deterministic. Optional Anthropic API key enables richer entity extraction.
Setup
The Engram server must be running locally. No API keys are required for basic operation.
Package install (recommended)
uv tool install engram
engramctl setup
engramctl start
engramctl install-openclaw
Docker install
docker pull ghcr.io/moshik21/engram:latest
docker run -d -p 8100:8100 --name engram ghcr.io/moshik21/engram:latest
Then add the OpenClaw skill:
engramctl install-openclaw
Source install
Clone the repo, review the code, then build locally:
git clone https://github.com/Moshik21/engram.git ~/engram
cd ~/engram/server
uv sync
uv run engram setup
uv run engram serve
Installer script (alternative)
An interactive installer is available. Review it before running:
# Review first:
curl -sSL https://raw.githubusercontent.com/Moshik21/engram/main/scripts/install.sh -o install.sh
less install.sh
Then run:
bash install.sh
MCP Server
For Claude Desktop / Claude Code integration:
uv run engram mcp # stdio (default)
uv run engram mcp --transport streamable-http --port 8200 # HTTP
Environment variables
All optional:
ANTHROPIC_API_KEY β enables richer entity extraction via Claude Haiku. Without it, Engram uses a deterministic narrow extractor (zero cost).ENGRAM_GROUP_ID β namespace for multi-brain setups. Defaults to "default". Most users never need to set this.The REST API is available at http://127.0.0.1:8100. Check status with
engramctl status.
If you know the current project path, bootstrap it once at session start so artifact-backed routing has parity with memory:
POST http://localhost:8100/api/knowledge/bootstrap
Content-Type: application/json{"project_path": "", "session_id": ""}
When to Observe vs Remember
Default to observe for most content. Use remember only for high-signal items.
Use observe when:
Use remember when:
How to Store Memories
To observe (fast, cheap, no extraction):
POST http://localhost:8100/api/knowledge/observe
Content-Type: application/json{"content": "", "source": "openclaw"}
To remember (full extraction with entities and relationships):
POST http://localhost:8100/api/knowledge/remember
Content-Type: application/json{"content": "", "source": "openclaw"}
To forget (soft delete outdated information):
POST http://localhost:8100/api/knowledge/forget
Content-Type: application/json{"entity_name": ""}
How to Recall Memories
At the start of every conversation, get broad context:
GET http://localhost:8100/api/knowledge/context
When the user references something from the past or you need relevant context:
GET http://localhost:8100/api/knowledge/recall?q=&limit=5
For project-truth questions, route first:
POST http://localhost:8100/api/knowledge/route
Content-Type: application/json{"question": "", "project_path": ""}
Use the returned answerContract as response policy, not just source routing.
If the route says inspect or reconcile, treat evidencePlan.requiredNextSources
as mandatory. Carry the same project_path into artifact/runtime calls before
answering:
GET http://localhost:8100/api/knowledge/artifacts/search?q=&project_path=&limit=5
GET http://localhost:8100/api/knowledge/runtime?project_path=
To search for specific entities:
GET http://localhost:8100/api/entities/search?q=
To search for specific facts and relationships:
GET http://localhost:8100/api/knowledge/facts?q=
search_facts is user-facing by default. Internal decision/artifact graph edges
stay hidden unless you explicitly opt into debug mode with
include_epistemic=true.
Guidelines
route, then satisfy requiredNextSources before answering.search_facts as a substitute for artifact inspection.answerContract.operator is compare, contrast raw defaults, shipped install defaults, repo posture, and runtime state when relevant.answerContract.operator is reconcile or unresolved_state_report, preserve earlier discussion versus current documented or implemented truth.answerContract.operator is recommend or plan, state the evidence first and then give advice or next steps.Memory Features
Prospective Memory (Intentions)
To set a reminder that fires when a related topic comes up:
POST http://localhost:8100/api/knowledge/intentions
Content-Type: application/json{"query": "", "action": "", "entity_names": [""]}
To list active intentions:
GET http://localhost:8100/api/knowledge/intentions
When an intention fires during recall, act on it naturally without announcing it was triggered.
Consolidation
Engram runs 15 offline consolidation phases that improve memory quality over time: triage, merge, infer, evidence_adjudicate, edge_adjudicate, replay, prune, compact, mature, semanticize, schema, reindex, graph_embed, microglia, dream.
To trigger a consolidation cycle manually:
POST http://localhost:8100/api/consolidation/trigger
Content-Type: application/json{"profile": "standard"}
To check consolidation status:
GET http://localhost:8100/api/consolidation/status
βοΈ Configuration
The Engram server must be running locally. No API keys are required for basic operation.
Package install (recommended)
uv tool install engram
engramctl setup
engramctl start
engramctl install-openclaw
Docker install
docker pull ghcr.io/moshik21/engram:latest
docker run -d -p 8100:8100 --name engram ghcr.io/moshik21/engram:latest
Then add the OpenClaw skill:
engramctl install-openclaw
Source install
Clone the repo, review the code, then build locally:
git clone https://github.com/Moshik21/engram.git ~/engram
cd ~/engram/server
uv sync
uv run engram setup
uv run engram serve
Installer script (alternative)
An interactive installer is available. Review it before running:
# Review first:
curl -sSL https://raw.githubusercontent.com/Moshik21/engram/main/scripts/install.sh -o install.sh
less install.sh
Then run:
bash install.sh
MCP Server
For Claude Desktop / Claude Code integration:
uv run engram mcp # stdio (default)
uv run engram mcp --transport streamable-http --port 8200 # HTTP
Environment variables
All optional:
ANTHROPIC_API_KEY β enables richer entity extraction via Claude Haiku. Without it, Engram uses a deterministic narrow extractor (zero cost).ENGRAM_GROUP_ID β namespace for multi-brain setups. Defaults to "default". Most users never need to set this.The REST API is available at http://127.0.0.1:8100. Check status with
engramctl status.
If you know the current project path, bootstrap it once at session start so artifact-backed routing has parity with memory:
POST http://localhost:8100/api/knowledge/bootstrap
Content-Type: application/json{"project_path": "", "session_id": ""}