Skip to content
Back to skills

Memento

ASecurity

Local persistent memory for OpenClaw agents. Captures conversations, extracts structured facts via LLM, and auto-recalls relevant knowledge before each turn. Privacy-first, all stored data stays local in SQLite.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentsgobashsqlnodegitapidatabase

Works with

  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add johnalbertini14-glitch/openclaw-skills --skill memento --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Memento?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Memento
[![Security: A โ€” Skills Directory](https://www.skillsdirectory.com/api/skills/johnalbertini14-glitch-memento/badge)](https://www.skillsdirectory.com/skills/johnalbertini14-glitch-memento)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: memento
description: Local persistent memory for OpenClaw agents. Captures conversations, extracts structured facts via LLM, and auto-recalls relevant knowledge before each turn. Privacy-first, all stored data stays local in SQLite.
metadata:
  version: "0.3.2"
  author: braibaud
  license: MIT
  repository: https://github.com/braibaud/Memento
  openclaw:
    emoji: "๐Ÿง "
    kind: plugin
    requires:
      node: ">=18.0.0"
      env:
        - ANTHROPIC_API_KEY
        - OPENAI_API_KEY
        - MISTRAL_API_KEY
        - MEMENTO_API_KEY
        - MEMENTO_WORKSPACE_MAIN
      config:
        - "~/.engram/conversations.sqlite"
        - "~/.engram/migration-config.json"
    install:
      - id: npm
        kind: node
        package: "@openclaw/memento"
        label: "Install Memento plugin (npm)"
    extensions:
      - "./src/index.ts"
  keywords:
    - memory
    - knowledge-base
    - recall
    - conversation
    - extraction
    - embeddings
    - sqlite
    - privacy
    - local
    - cross-agent
---

# Memento โ€” Local Persistent Memory for OpenClaw Agents

Memento gives your agents long-term memory. It captures conversations, extracts structured facts using an LLM, and auto-injects relevant knowledge before each AI turn.

**All stored data stays on your machine โ€” no cloud sync, no subscriptions.** Extraction uses your configured LLM provider; use a local model (Ollama) for fully air-gapped operation.

> โš ๏ธ **Privacy note:** When `autoExtract` is enabled, conversation segments are sent to your configured LLM provider for fact extraction. If you use a cloud provider (Anthropic, OpenAI, Mistral), that text leaves your machine. For fully local operation, set `extractionModel` to `ollama/<model>` and keep Ollama running locally.

## What It Does

1. **Captures** every conversation turn, buffered per session
2. **Extracts** structured facts (preferences, decisions, people, action items) via configurable LLM (opt-in โ€” see Privacy section)
3. **Recalls** relevant facts before each AI turn using FTS5 keyword search + optional semantic embeddings (BGE-M3)
4. **Respects privacy** โ€” facts are classified as `shared`, `private`, or `secret` based on content, with hard overrides for sensitive categories (medical, financial, credentials)
5. **Cross-agent knowledge** โ€” shared facts flow between agents with provenance tags; private/secret facts never cross boundaries

## Quick Start

Install the plugin, restart your gateway, and Memento starts capturing automatically. Extraction is **off by default** โ€” enable it explicitly when ready.

### Optional: Semantic Search

Download a local embedding model for richer recall:

```bash
mkdir -p ~/.node-llama-cpp/models
curl -L -o ~/.node-llama-cpp/models/bge-m3-Q8_0.gguf \
  "https://huggingface.co/gpustack/bge-m3-GGUF/resolve/main/bge-m3-Q8_0.gguf"
```

## Environment Variables

All environment variables are **optional** โ€” you only need the one matching your chosen LLM provider:

| Variable | When Needed |
|----------|-------------|
| `ANTHROPIC_API_KEY` | Using `anthropic/*` models for extraction |
| `OPENAI_API_KEY` | Using `openai/*` models for extraction |
| `MISTRAL_API_KEY` | Using `mistral/*` models for extraction |
| `MEMENTO_API_KEY` | Generic fallback for any provider |
| `MEMENTO_WORKSPACE_MAIN` | Migration only: path to agent workspace for bootstrapping |

No API key needed for `ollama/*` models (local inference).

## Configuration

Add to your `openclaw.json` under `plugins.entries.memento.config`:

```json
{
  "memento": {
    "autoCapture": true,
    "extractionModel": "anthropic/claude-sonnet-4-6",
    "extraction": {
      "autoExtract": true,
      "minTurnsForExtraction": 3
    },
    "recall": {
      "autoRecall": true,
      "maxFacts": 20,
      "crossAgentRecall": true
    }
  }
}
```

> **`autoExtract: true`** is an explicit opt-in (default: `false`). When enabled, conversation segments are sent to the configured `extractionModel` for LLM-based fact extraction. Omit or set to `false` to keep everything local.

## Data Storage

Memento stores all data locally:

| Path | Contents |
|------|----------|
| `~/.engram/conversations.sqlite` | Main database: conversations, facts, embeddings |
| `~/.engram/segments/*.jsonl` | Human-readable conversation backups |
| `~/.engram/migration-config.json` | Optional: migration workspace paths (only for bootstrapping) |

The `~/.engram` directory name is a legacy from when the project was called Engram. It will not change to avoid breaking existing installations.

## Privacy & Data Flow

| Feature | Data leaves machine? | Details |
|---------|---------------------|---------|
| `autoCapture` (default: `true`) | โŒ No | Writes to local SQLite + JSONL only |
| `autoExtract` (default: `false`) | โš ๏ธ Yes, if cloud LLM | Sends conversation text to configured provider. Use `ollama/*` for local. |
| `autoRecall` (default: `true`) | โŒ No | Reads from local SQLite only |
| Secret facts | โŒ Never | Filtered from extraction context โ€” never sent to any LLM |
| Migration | โŒ No | Reads local workspace files, writes to local SQLite |

## Migration (Bootstrap from Existing Memory Files)

To bootstrap Memento from existing agent memory files:

1. Create `~/.engram/migration-config.json` or set `MEMENTO_WORKSPACE_MAIN`:

```json
{
  "agents": [
    {
      "agentId": "main",
      "workspace": "/path/to/your-workspace",
      "paths": ["MEMORY.md", "memory/*.md"]
    }
  ]
}
```

2. **Always dry-run first** to verify which files will be read:

```bash
npx tsx src/extraction/migrate.ts --all --dry-run
```

3. Run the actual migration:

```bash
npx tsx src/extraction/migrate.ts --all
```

โš ๏ธ Migration reads files from the workspace paths you specify. Review the config before running.

## Architecture

- **Capture layer** โ€” hooks `message:received` + `message:sent`, buffers multi-turn segments
- **Extraction layer** โ€” async LLM extraction with deduplication, occurrence tracking, and temporal pattern detection
- **Storage layer** โ€” SQLite (better-sqlite3) with FTS5 full-text search + optional vector embeddings
- **Recall layer** โ€” multi-factor scoring (recency ร— frequency ร— category weight) injected via `before_prompt_build` hook

## Requirements

- OpenClaw 2026.2.20+
- Node.js 18+
- An API key for your preferred LLM provider (for extraction โ€” not needed if extraction is disabled or using Ollama)
- Optional: GPU for accelerated embedding search (falls back to CPU gracefully)

## Install

```bash
# From ClawHub
clawhub install memento

# Or for local development
git clone https://github.com/braibaud/Memento
cd Memento
npm install
```

Note: `better-sqlite3` includes native bindings that compile during `npm install`. This is expected behavior for SQLite access.

Files in this skill

  • DESIGN.md11.6 KB
  • MIGRATION-SPEC.md4.1 KB
  • PHASE2-SPEC.md7.7 KB
  • README.md9.7 KB
  • SKILL.md6.7 KB
  • _meta.json268 B
  • assets/LOGO-BRIEF.md3.8 KB
  • docs/PROJECT.md17 KB
  • openclaw.plugin.json4.1 KB
  • package-lock.json17.8 KB
  • package.json418 B
  • src/capture/buffer.ts3.7 KB
  • src/capture/writer.ts5.7 KB
  • src/config.ts7.2 KB
  • src/extraction/classifier.ts3 KB
  • src/extraction/deduplicator.ts4.5 KB
  • src/extraction/extractor.ts17.2 KB
  • src/extraction/migrate.ts19.4 KB
  • src/extraction/trigger.ts5.5 KB
  • src/index.ts10.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents โ†’

Comments

Loading commentsโ€ฆ

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.