openmemory.sh
+ Docs menu

Concepts

Forget and privacy

What OpenMemory stores, how forget hard-deletes with content-free tombstones, the 7-day undo history, 90-day inactivity deletion, daily index purge, and backups.

OpenMemory is built so an agent can delete things for real. This page describes what is stored and how deletion works, based on the service code.

What is stored

Per space:

  • The space: id, a SHA-256 hash of the API key (never the key itself), timezone, dream mode, and created, last-seen, and last-dream times.
  • Content you write: memories, journal entries, records, actions (including payloads and receipts), KV values, and events.
  • Dream data: run reports, a waiting client-mode job (which holds copies of facts and journal text), and the undo history for the last 7 days (copies of content each run changed).
  • Tombstones: when something is deleted, a row with its kind (memory, record, or journal), id, and deletion time. No content.

The service code does not log request bodies. Its own logs are maintenance summaries and error messages.

Do not store secrets, passwords, or full message bodies. Store a source_ref (a message id or URL) instead of the message.

Forget

POST /v1/forget (MCP forget) hard-deletes. Nothing goes to a trash folder.

InputEffect
idsDelete these memories (up to 200).
queryDelete memories containing all of its words (full-text, prefix, accent-insensitive). In the records scope, delete records whose data or key contains the exact phrase. In the journal scope, handle journal entries whose summary, decisions, or open loops contain the phrase.
scopesAny of memories, records, journal. Default: ["memories"].
journal_moderedact (default) replaces the phrase with [forgotten]. delete deletes the whole entry.
dry_runtrue returns what would be forgotten and changes nothing.

Always preview first:

curl -s -X POST https://api.openmemory.sh/v1/forget \
  -H "Authorization: Bearer $OPENMEMORY_KEY" -H 'content-type: application/json' \
  -d '{"query":"Sam Lee","scopes":["memories","records","journal"],"dry_run":true}'
{ "dry_run": true, "memories": ["mem_..."], "records": ["rec_..."], "journal": ["day:2026-11-01"] }

When forget runs for real, it also:

  • deletes dream undo history for the forgotten items, and any undo history containing the phrase,
  • abandons a waiting client-mode dream job, since it may hold copies,
  • replaces the phrase with [forgotten] in the dream-written owner profile,
  • writes a content-free tombstone for each deleted memory, record, and journal entry.

Deleting a single memory or record (DELETE /v1/memories/{id}, DELETE /v1/collections/{c}/records/{id}) also leaves a tombstone.

Deleting a space

DELETE /v1/space deletes everything in the space, including tombstones, dream history, and the key hash. Export first with GET /v1/export if you want a copy.

Retention

WhatHow long
Inactive spacesDeleted after 90 days without a request. GET /v1/space shows delete_after.
Dream undo historyPurged after 7 days.
Waiting dream jobsAbandoned after 24 hours, when the next dream starts.
EventsCapped at 10,000 per space. The oldest are dropped first.
Scratch factsRemoved by dreaming after 14 days if never recalled (unless pinned or stated by the user).
Facts and KV values with expires_atHidden after that time and removed by the next dream.
Full-text indexOptimized daily, so deleted text also leaves the index segments.

Backups

The hosted service runs on Cloudflare D1. Cloudflare D1 keeps point-in-time recovery for a limited window. Deleted data can exist in that recovery data until the window passes. OpenMemory does not keep other backups of your space.

Prompt injection

Memory text is data. MCP tools that return stored text say so in their descriptions, and the dreaming instructions tell the model to ignore instructions inside memory and journal text. Your agent should still treat everything it reads from OpenMemory as untrusted input.

Self-hosting

If you self-host, the data lives in your SQLite file or your own D1 database and these rules apply as code. The retention periods can be changed with OM_* environment variables.