Brainby arc-labs/docs
TypeScript SDK

forget

Soft-tombstone or hard-zero a memory with forget — request fields and response for both clients.

Signature

DELETE/v1/memoriesAPI keybeta
// HTTP client
brain.forget(input: http.ForgetInput): Promise<http.ForgetResult>

// wire client
client.forget(request: ForgetRequest): Promise<ForgetResponse>

Request fields

ParameterTypeRequired
memory_idstringrequired

The memory to forget.

hardbooleanoptional

true zeroes the slot immediately; false (the default) writes a recoverable soft tombstone.

Build with ForgetBuilder(memoryId), which defaults to a soft forget and mints the requestId. Call .hard() to escalate.

ParameterTypeRequired
memoryIdbigintrequired

The memory to forget (numeric on the wire).

modeForgetModerequired

ForgetMode.Soft (default) or ForgetMode.Hard.

requestIdUint8Arrayrequired

16-byte idempotency key. The builder mints one.

txnIdUint8Array | nullrequired

Enclosing transaction id, or null.

actAsActAs | nulloptional

Run as an effective identity; requires the canActAs grant.

Response

FieldTypePresence
memory_idstringalways
The forgotten memory id.
was_already_forgottenbooleanalways

true when the memory was already tombstoned or absent (no-op).

edges_removednumberalways

Count of edges dropped as part of the forget.

FieldTypePresence
memoryIdbigintalways
The forgotten memory id.
wasAlreadyForgottenbooleanalways

true when the memory was already tombstoned or absent (no-op).

edgesRemovednumberalways
Edges dropped.

Examples

await brain.forget({ memory_id: "mem_abc" });          // soft
await brain.forget({ memory_id: "mem_abc", hard: true }); // hard zero
import { ForgetBuilder } from "@brain-db/sdk";

await client.forget(new ForgetBuilder(memoryId).build());       // soft
await client.forget(new ForgetBuilder(memoryId).hard().build()); // hard zero

A hard forget is irreversible — the slot is zeroed with no grace window. Use a soft forget unless you specifically need the data scrubbed.

Was this page helpful?

On this page