/install engram-brain
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": "\x3Cabsolute project path>", "session_id": "\x3Coptional session id>"}
When to Observe vs Remember
Default to observe for most content. Use remember only for high-signal items.
Use observe when:
- General conversation context or topics discussed
- Information that might be useful later but is not critical
- Bulk context from a long conversation
- You are uncertain whether something is worth a full remember
Use remember when:
- The user explicitly asks you to remember something
- Personal identity facts (name, location, job title)
- Explicit preferences or corrections to prior knowledge
- Key decisions that will affect future interactions
- Goals, plans, or deadlines with concrete details
How to Store Memories
To observe (fast, cheap, no extraction):
POST http://localhost:8100/api/knowledge/observe
Content-Type: application/json
{"content": "\x3Ctext to store>", "source": "openclaw"}
To remember (full extraction with entities and relationships):
POST http://localhost:8100/api/knowledge/remember
Content-Type: application/json
{"content": "\x3Cimportant text>", "source": "openclaw"}
To forget (soft delete outdated information):
POST http://localhost:8100/api/knowledge/forget
Content-Type: application/json
{"entity_name": "\x3Centity to forget>"}
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=\x3Cquery>&limit=5
For project-truth questions, route first:
POST http://localhost:8100/api/knowledge/route
Content-Type: application/json
{"question": "\x3Cuser question>", "project_path": "\x3Coptional 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=\x3Cquery>&project_path=\x3Coptional path>&limit=5
GET http://localhost:8100/api/knowledge/runtime?project_path=\x3Coptional path>
To search for specific entities:
GET http://localhost:8100/api/entities/search?q=\x3Cname>
To search for specific facts and relationships:
GET http://localhost:8100/api/knowledge/facts?q=\x3Cquery>
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
- Call the context endpoint once at the start of each new conversation
- For personal continuity turns like "my son did great today" or "talked to Sarah about it", recall first.
- For install/config/current-truth questions like "how do we install the OpenClaw skill?" or "is full mode rework by default?", call
route, then satisfyrequiredNextSourcesbefore answering. - For decision/history questions like "what did we decide about launching Engram publicly?", treat it as reconciliation: use memory plus artifacts/runtime before answering, and do not use
search_factsas a substitute for artifact inspection. - If
answerContract.operatoriscompare, contrast raw defaults, shipped install defaults, repo posture, and runtime state when relevant. - If
answerContract.operatorisreconcileorunresolved_state_report, preserve earlier discussion versus current documented or implemented truth. - If
answerContract.operatorisrecommendorplan, state the evidence first and then give advice or next steps. - When recalling, integrate information naturally. Do not say "my memory system found..."
- If recall returns no results, do not mention it. Just respond normally.
- If uncertain whether something is worth remembering, observe it
- Always prioritize the user's most recent statements over older memories if there is a conflict
- When the user corrects previously stored information, forget the old info then remember the corrected version
Memory Features
- Activation-aware retrieval: Memories accessed more frequently and recently rank higher
- Knowledge graph: Entities and relationships are extracted and connected
- 15-phase consolidation: Offline cycles merge duplicates, infer missing links, adjudicate evidence, prune noise, mature entities, form schemas, and discover cross-domain patterns
- Memory maturation: Entities graduate from episodic (recent) to semantic (durable) over time
- Prospective memory: Set intentions that fire when related topics come up
- Dream associations: Cross-domain creative connections discovered during consolidation
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": "\x3Ctopic to watch for>", "action": "\x3Cwhat to do when triggered>", "entity_names": ["\x3Crelated entity>"]}
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
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install engram-brain - 安装完成后,直接呼叫该 Skill 的名称或使用
/engram-brain触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Engram Memory 是什么?
Persistent long-term memory powered by knowledge graphs, ACT-R activation, and 15-phase consolidation. Remember conversations across sessions, recall relevan... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 166 次。
如何安装 Engram Memory?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install engram-brain」即可一键安装,无需额外配置。
Engram Memory 是免费的吗?
是的,Engram Memory 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Engram Memory 支持哪些平台?
Engram Memory 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Engram Memory?
由 Moshik21(@moshik21)开发并维护,当前版本 v0.3.1。