forget
Soft-tombstone or hard-zero a memory with forget — request fields and response for both clients.
Signature
// HTTP client
brain.forget(input: http.ForgetInput): Promise<http.ForgetResult>
// wire client
client.forget(request: ForgetRequest): Promise<ForgetResponse>Request fields
memory_idstringrequiredThe memory to forget.
hardbooleanoptionaltrue 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.
memoryIdbigintrequiredThe memory to forget (numeric on the wire).
modeForgetModerequiredForgetMode.Soft (default) or ForgetMode.Hard.
requestIdUint8Arrayrequired16-byte idempotency key. The builder mints one.
txnIdUint8Array | nullrequiredEnclosing transaction id, or null.
actAsActAs | nulloptionalRun as an effective identity; requires the canActAs grant.
Response
memory_idstringalwayswas_already_forgottenbooleanalwaystrue when the memory was already tombstoned or absent (no-op).
edges_removednumberalwaysCount of edges dropped as part of the forget.
memoryIdbigintalwayswasAlreadyForgottenbooleanalwaystrue when the memory was already tombstoned or absent (no-op).
edgesRemovednumberalwaysExamples
await brain.forget({ memory_id: "mem_abc" }); // soft
await brain.forget({ memory_id: "mem_abc", hard: true }); // hard zeroimport { ForgetBuilder } from "@brain-db/sdk";
await client.forget(new ForgetBuilder(memoryId).build()); // soft
await client.forget(new ForgetBuilder(memoryId).hard().build()); // hard zeroA 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?