Skip to content

Prune old memories

Over time an eden-memory database accumulates expired, duplicated, or out-of-scope memories. eden_prune lets you remove them in bulk, scoped to the identities and workspaces you choose. This guide shows soft deletion and optional permanent deletion.

  • eden-memory running as an MCP server.
  • The scope fields of the memories you want to remove.
  • A clear idea of whether you need soft-delete (recoverable until vacuum/purge) or hard-delete (permanent).

eden_prune filters by any combination of:

  • agent_id
  • user_id
  • org_id
  • workspace_id
  • keywords
  • expired_only: true
  • org_empty, workspace_empty, agent_empty, user_empty — match rows where that scope is empty

Example: target memories in an old workspace.

{
"org_id": "your-org",
"workspace_id": "old-project",
"keywords": "deprecated"
}

Without confirm: true, eden_prune returns the matching count and sample IDs without deleting anything.

{
"org_id": "your-org",
"workspace_id": "old-project",
"keywords": "deprecated",
"expired_only": false,
"dry_run": true
}

Review the sample carefully. Pruning the wrong scope can remove memories you still need.

Soft-delete is the default. Pass confirm: true and dry_run: false.

{
"org_id": "your-org",
"workspace_id": "old-project",
"keywords": "deprecated",
"expired_only": false,
"confirm": true,
"dry_run": false
}

Soft-deleted memories are hidden from recall and search but remain in the database until they are purged by a hard prune or a vacuum.

Use hard-delete only when you are sure. You must pass both hard: true and yes_i_really_want_to_delete: true.

{
"org_id": "your-org",
"workspace_id": "old-project",
"keywords": "deprecated",
"expired_only": false,
"hard": true,
"yes_i_really_want_to_delete": true,
"confirm": true,
"dry_run": false
}

Hard-deleted rows are removed from SQLite and cannot be recovered from this database.

To remove only memories whose TTL has passed:

{
"expired_only": true,
"confirm": true,
"dry_run": false
}

This is useful for periodic housekeeping without touching live memories.

  • Dry-run shows the exact count and sample IDs.
  • Soft-delete hides matching memories from recall and search.
  • Hard-delete permanently removes matching memories.
  • eden_health reflects the reduced total count after hard deletion.