5.13 The forget_batch tool

Soft-deletes up to MAX_BATCH_SIZE (default 200) memories in a single call. Soft-delete only by design — a bulk hard delete has no tombstone trail and is intentionally not exposed here. Use forget with hard_delete=true for individual rows that need to be erased completely.

Strongly prefer this over calling forget repeatedly during cleanup. A batch payload carries only a list of integer ids, which is also less likely to be misclassified by an LLM client’s safety filter than repeated single-id forgets whose context contains the per-row memory text.

5.13.1 Inputs

ids

Required array of integers. The memory ids to forget. Maximum 200 per call.

reason

String. Optional. Shared explanation recorded as forget_reason on every soft-deleted row in the batch.

dry_run

Boolean. Optional, default false. When true, validate every id and report what would happen, but make no changes. Each result still reports already_deleted reflecting current state.

5.13.2 Output

{
  "ok": true,
  "dry_run": false,
  "results": [
    { "input_index": 0, "id": 144, "ok": true,
       "already_deleted": false, "message": "Forgotten" },
    { "input_index": 1, "id": 999999, "ok": false,
       "error": { "code": "NOT_FOUND",
                  "message": "Memory 999999 not found." } }
  ],
  "summary": { "total": 2, "deleted": 1,
                "already_deleted": 0, "errors": 1 }
}

If a row was already soft-deleted, the tombstone metadata is updated (reason rewritten if supplied) and already_deleted is reported true.

5.13.3 Errors

Batch-level: INVALID_INPUT (empty list, invalid reason), LIMIT_EXCEEDED (over 200 items). Per-item errors appear inside results.