FishMem

Delete

Remove a single memory by id, or wipe every memory in a scope.

Delete has two different retention effects. Deleting one memory by id creates a tombstone, removes it from recall, and retains its audit history. Deleting a whole scope is a permanent bulk purge; handle it with care.

Delete one by id

Pass the memory id in the path. The response confirms the deletion.

curl -X DELETE https://fishmem.com/v1/memories/mem_124 \
  -H "Authorization: Bearer fm_..." \
  -H "Idempotency-Key: delete-mem-124"
import { FishMem } from "@fishmem/sdk";

const fishmem = new FishMem({ apiKey });
await fishmem.memories.delete("mem_124", {
  idempotencyKey: "delete-mem-124",
});

Response:

{ "id": "mem_124", "deleted": true }

Delete all in a scope

Pass user_id (or agent_id / run_id) as a query parameter to delete every memory in that scope. The response returns how many were removed.

curl -X DELETE "https://fishmem.com/v1/memories?user_id=alice" \
  -H "Authorization: Bearer fm_..." \
  -H "Idempotency-Key: delete-all-alice-v1"
await fishmem.memories.deleteAll(
  { user_id: "alice" },
  { idempotencyKey: "delete-all-alice-v1" },
);

Response:

{ "deleted": 12 }

Caution

Delete-all is irreversible and matches every memory in the scope you name. Cloud requires an idempotency key. The first execution freezes the exact target IDs; a retry returns the original count and does not delete records created later. Reusing that key for another scope is rejected. Before calling it, double-check the scope — a wrong user_id still purges a different user's records. When in doubt, list every page first.

A synchronous delete-all is capped at 25,000 matching memories. An oversized scope returns 413 DELETE_ALL_TOO_LARGE before any deletion; narrow the scope and use a new idempotency key.

Parameters

OperationParameterNotes
Delete one{id} (path)The memory id.
Delete alluser_idScope to wipe.
Delete allagent_idScope to wipe.
Delete allrun_idScope to wipe.

Credits

Deletes are free.

See the full contracts at /api-reference/delete and /api-reference/delete-all.

On this page