ββββββββββββ βββ βββββββ βββββββ ββββββ ββββ ββββ
βββββββββββββ βββββββββββ βββββββββββββββββββββ βββββ
ββββββ ββββββ ββββββ βββββββββββββββββββββββββββββββ
ββββββ βββββββββββββ ββββββββββββββββββββββββββββββ
βββββββββββ ββββββββββββββββββ ββββββ ββββββ βββ βββ
βββββββββββ βββββ βββββββ βββ ββββββ ββββββ βββ
hybrid long-term memory for OpenClaw agents
engram (n.) β the physical/biochemical trace a memory leaves behind. The thing that makes "remembering" actually possible.
Engram is a memory plugin for OpenClaw agents. It gives them a brain that doesn't forget between sessions β backed by SQLite + FTS5 for exact, structured recall and LanceDB for fuzzy semantic search over embeddings.
- π§ Hybrid recall β structured key/value facts + semantic vector search, queried together
- π FTS5 full-text search over fact text
- π Categories β
preference,fact,decision,entity,other - β³ Decay classes β
permanent,stable,active,session,checkpoint(with confidence decay) - πͺ Auto-capture / auto-recall hooks (configurable)
- πΎ Local-first β your memory stays on your machine
- π Embeddings via OpenAI (
text-embedding-3-smallor-large)
One-liner (clones from this repo, copies the plugin into OpenClaw, wires the config):
curl -fsSL https://raw.githubusercontent.com/NanoFlow-io/engram/main/scripts/install.sh | bashOr clone and run manually:
git clone https://github.com/NanoFlow-io/engram.git
cd engram
bash scripts/install.shAfter install:
export OPENAI_API_KEY="sk-proj-..." # if not already set
openclaw gateway restartVerify it loaded β look for engram: initialized in the gateway log.
From inside an OpenClaw agent session:
> Remember that I prefer dark mode and my coffee black.
Next session:
> What do you remember about me?
The agent recalls via the memory_recall / memory_store tools, both backed by Engram.
Engram is configured under plugins.entries.engram in ~/.openclaw/openclaw.json:
{
"plugins": {
"slots": { "memory": "engram" },
"entries": {
"engram": {
"enabled": true,
"hooks": { "allowConversationAccess": true },
"config": {
"embedding": {
"apiKey": "${OPENAI_API_KEY}",
"model": "text-embedding-3-small"
},
"autoCapture": true,
"autoRecall": false,
"sqlitePath": "~/.openclaw/memory/facts.db",
"lanceDbPath": "~/.openclaw/memory/lancedb"
}
}
}
}
}| Field | Default | Notes |
|---|---|---|
embedding.apiKey |
β | required (use ${OPENAI_API_KEY}) |
embedding.model |
text-embedding-3-small |
or text-embedding-3-large |
autoCapture |
true |
extract memories from conversations |
autoRecall |
false |
inject relevant memories into context. Off by default β can be noisy. |
sqlitePath |
~/.openclaw/memory/facts.db |
structured store |
lanceDbPath |
~/.openclaw/memory/lancedb |
vector store |
Engram registers a engram CLI command with subcommands:
openclaw engram stats # show fact/vector counts
openclaw engram prune # remove expired memories
openclaw engram checkpoint # manual checkpoint
openclaw engram backfill-decay # backfill decay classes on legacy data
openclaw engram extract-daily # extract from daily notes
openclaw engram search <q> # hybrid search
openclaw engram lookup <key> # exact lookupVerify after install:
openclaw plugins doctor
openclaw plugins inspect engram --runtime βββββββββββββββββββββββ
β OpenClaw Agent β
ββββββββββββ¬βββββββββββ
β
ββββββββββββββββ΄βββββββββββββββ
β Engram Plugin β
ββββββββ¬ββββββββββββββββ¬βββββββ
β β
ββββββββββββΌββββββ βββββββΌββββββββββ
β SQLite + FTS5 β β LanceDB β
β structured β β vectors β
β facts, keys, β β semantic β
β categories β β recall β
ββββββββββββββββββ βββββββββββββββββ
β² β²
ββββββββ¬βββββββββ
β
ββββββββΌβββββββ
β OpenAI β
β embeddings β
βββββββββββββββ
Every memory gets written to both stores. Recall queries hit both and merge results by relevance.
bash scripts/uninstall.shAsks before wiping memory data.
PRs welcome. Open an issue if you want to discuss architecture changes first.
MIT Β© NanoFlow
βββ remember everything. forget nothing. βββ