Skip to content

NanoFlow-io/engram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Engram

   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•—
   β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘
   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘
   β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘
   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘
   β•šβ•β•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•šβ•β•  β•šβ•β•β•šβ•β•     β•šβ•β•

           hybrid long-term memory for OpenClaw agents

License: MIT OpenClaw

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.

✨ Features

  • 🧠 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-small or -large)

πŸš€ Install

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 | bash

Or clone and run manually:

git clone https://github.com/NanoFlow-io/engram.git
cd engram
bash scripts/install.sh

After install:

export OPENAI_API_KEY="sk-proj-..."   # if not already set
openclaw gateway restart

Verify it loaded β€” look for engram: initialized in the gateway log.

πŸ§ͺ Try It

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.

βš™οΈ Configuration

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

πŸ›  CLI

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 lookup

Verify after install:

openclaw plugins doctor
openclaw plugins inspect engram --runtime

🧱 Architecture

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   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.

πŸ—‘ Uninstall

bash scripts/uninstall.sh

Asks before wiping memory data.

🀝 Contributing

PRs welcome. Open an issue if you want to discuss architecture changes first.

πŸ“œ License

MIT Β© NanoFlow


   β–‘β–‘β–‘ remember everything. forget nothing. β–‘β–‘β–‘

About

🧠 Hybrid long-term memory plugin for OpenClaw agents β€” SQLite+FTS5 for structured facts, LanceDB for semantic recall

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors