Xpersona
O

OpenMem - Longterm Compressed Memory

CLAWHUB · Unverified

SQLite long-term memory compression system for extended memory life. Adds tools for agents to control their memory functions.

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s175fz1kn7q6m6m0fxfgnacpfn84gwyw:openmem
  1. Install using `clawhub skill install s175fz1kn7q6m6m0fxfgnacpfn84gwyw:openmem` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/danavfrost/openmem before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-danavfrost-openmem/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

128,131 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: openmem
description: "SQLite long-term memory compression system for extended memory life. Adds tools for agents to control their memory functions."
metadata:
  {
    "openclaw": {
      "emoji": "🧠",
      "requires": { "bins": ["python3"] },
      "optionalEnv": [
        "OPENMEM_DB",
        "OPENMEM_SESSIONS_DIR",
        "OPENMEM_BOOTSTRAP_LIMIT",
        "OPENMEM_COMPRESS_INACTIVITY"
      ],
      "reads": [
        "~/.openclaw/agents/main/sessions/*.jsonl"
      ],
      "writes": [
        "~/.openclaw/workspace/memory/openmem.db",
        "~/.openclaw/workspace/memory/openmem-cache.json",
        "~/.openclaw/workspace/memory/auto_compress_state.json",
        "~/.openclaw/logs/openmem-compress.log"
      ],
      "credentialAccess": "none — compression uses `openclaw capability model run` which handles provider auth internally"
    }
  }
---

# OpenMem v1.3.0

SQLite-backed long-term memory.

MIT License — free to use, modify, redistribute. No attribution required.

## Privacy & Scope

**Read this before installing.**

- **Full session transcripts are read during compression.** Both manual (`compress.py read`) and automated (`auto_compress.py`) compression read the complete raw JSONL session files. The full content is passed to the extractor — everything in that session is visible. Only 3–10 selected items are written to the DB; the raw content is never stored permanently. This is intentional but privacy-sensitive: sessions may contain passwords, keys, or personal data entered during a conversation.

- **Automated compression destroys original session files.** `auto_compress.py` replaces session JSONL files older than 24h with a one-line stub after memories are confirmed. This is irreversible. Run with `--no-wipe` to disable this behaviour, or skip auto-compression entirely.

- **Network calls are made during auto-compression.** `auto_compress.py` calls `openclaw capability model run` to extract memories using the user's configured model. OpenClaw handles all provider routing and auth — session excerpts are passed as a prompt through the local gateway. The MCP server itself makes no network calls.

- **Cache file is plaintext.** After every memory write, top memories are written to `openmem-cache.json` in the same directory as the DB, unencrypted. Trust level is identical to the DB file.

- **Persistent presence.** `setup.py` registers an MCP server and an hourly cron job with your OpenClaw gateway. OpenMem has ongoing read access to session files and write access to the local DB while enabled. Run `uninstall.py` to remove all registered components.

## Filesystem & Credential Access

What this skill reads and writes — declared up-front.

**Reads:**
- `~/.openclaw/agents/main/sessions/*.jsonl` — session transcripts, read in full during compression (see Privacy above).

**Writes:**
- `~/.openclaw/workspace/memory/openmem.db` — SQLite memory database
- `~/.openclaw/workspace/memory/openmem-cache.json` — plaintext top-memory 

_meta.json

{
  "ownerId": "kn76e58kgy17anserphwcpwya984h3j9",
  "slug": "openmem",
  "version": "1.3.0",
  "publishedAt": 1778081143933
}

references/schema.md

# OpenMem Database Schema

Default path: `~/.openclaw/workspace/memory/openmem.db`
Override with `OPENMEM_DB` env var.

## Table: memories

The primary store. Every row is one discrete memory.

| Column | Type | Description |
|---|---|---|
| `id` | INTEGER PK | Auto-increment |
| `content` | TEXT UNIQUE | The memory text. Duplicate content is silently deduplicated. |
| `category` | TEXT | One of: `fact`, `insight`, `preference`, `correction`, `event`, `general` |
| `source` | TEXT | Where it came from: `manual`, `session:<id>`, `hook`, etc. |
| `importance` | REAL | 0.0–1.0. Higher = more likely to surface in search/bootstrap. |
| `session_id` | TEXT | OpenClaw session ID this came from (nullable) |
| `created_at` | INTEGER | Unix timestamp |
| `updated_at` | INTEGER | Unix timestamp |
| `access_count` | INTEGER | Incremented on every read. Used for future LRU eviction. |

## Table: memories_fts

FTS5 virtual table mirroring `memories.content`. Uses Porter stemmer.
Kept in sync automatically via triggers on INSERT/UPDATE/DELETE.

Search uses `bm25()` ranking combined with importance and recency:

```
score = bm25_rank - (importance × 2.0) - (age_in_days × 0.05)
```

Lower score = better match (bm25 returns negative values).

## Table: compressed_sessions

Tracks which OpenClaw sessions have been compressed into memories.

| Column | Type | Description |
|---|---|---|
| `session_id` | TEXT PK | OpenClaw session UUID |
| `session_file` | TEXT | Filename |
| `compressed_at` | INTEGER | Unix timestamp |
| `memory_count` | INTEGER | How many memories were extracted |

## Category Guide

| Category | Use for |
|---|---|
| `fact` | Objective facts about the world, system, or codebase |
| `insight` | Learned patterns, conclusions, or non-obvious observations |
| `preference` | User preferences, style choices, or stated desires |
| `correction` | Mistakes made and the correct approach |
| `event` | Things that happened (deployments, incidents, milestones) |
| `general` | Anything that doesn't fit above |

hooks/openclaw/HOOK.md

---
name: openmem
description: "Injects long-term memories from OpenMem into the agent context at session start"
metadata: {"openclaw":{"emoji":"🧠","events":["agent:bootstrap"]}}
---

# OpenMem Bootstrap Hook

Fires on `agent:bootstrap` and injects an `OPENMEM.md` virtual file containing
your most important long-term memories. No-ops silently if the database doesn't
exist yet.

## Setup

```bash
# Install the skill first, then enable the hook:
openclaw hooks enable openmem

# Initialize the database:
python3 ~/.openclaw/workspace/skills/openmem/scripts/mem.py init
```

## Configuration (environment variables)

| Variable | Default | Description |
|---|---|---|
| `OPENMEM_DB` | `~/.openclaw/workspace/memory/openmem.db` | Database path |
| `OPENMEM_BOOTSTRAP_LIMIT` | `12` | Max memories to inject at startup |
| `OPENMEM_PYTHON` | `python3` | Python interpreter to use |

skill-card.md

## Description:

SQLite long-term memory compression system for extended memory life. Adds tools for agents to control their memory functions.

This skill is ready for commercial/non-commercial use.

## Publisher:

[danavfrost](https://clawhub.ai/user/danavfrost)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and external OpenClaw users use this skill to persist durable preferences, facts, corrections, and project context across agent sessions, then surface relevant memories through MCP tools and bootstrap context.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Compression reads full OpenClaw session transcripts and may pass excerpts through the configured model provider.

Mitigation: Install only when transcript processing is acceptable; avoid entering secrets in sessions that may be compressed and review extracted memories regularly.

Risk: Default automation can overwrite older session transcripts after memories are confirmed.

Mitigation: Use `--no-wipe` or skip the cron setup unless transcript replacement is explicitly desired.

Risk: Selected memories and the bootstrap cache are stored in plaintext and injected into future sessions.

Mitigation: Keep the memory directory access-restricted and delete or edit memories that should not persist.

Risk: The setup flow registers persistent MCP, hook, and scheduled compression components.

Mitigation: Run the uninstall script or remove the registered OpenClaw components when ongoing memory access is no longer needed.

## Reference(s):

- [OpenMem Database Schema](references/schema.md)
- [OpenMem ClawHub Release](https://clawhub.ai/danavfrost/skills/openmem)
- [OpenAuto Integration](https://clawhub.ai/halthelobster/openauto)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, configuration, guidance]

**Output Format:** [Markdown bootstrap context, JSON MCP tool responses, and CLI text output]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Stores selected memories locally in SQLite and writes a plaintext cache used for bootstrap injection.]

## Skill Version(s):

1.3.0 (source: server release metadata and artifact version references)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to OpenMem - Longterm Compressed Memory and adjacent AI workflows.