Brainby arc-labs/docs
Python SDK

Forget

Delete a memory with forget — soft tombstone vs hard zero, on both the HTTP and wire clients.

HTTP

DELETE/v1/memoriesBearerstable
client.forget(memory_id: str, hard: bool = False) -> ForgetResult
ParameterTypeRequired
memory_idstrrequired

The id of the memory to forget.

hardbooloptional

False (default) soft-tombstones with a grace period; True zeroes the memory immediately.

from brain_db_sdk import BrainHttpClient

client = BrainHttpClient("sk-...", base_url="https://api.arc-labs.ai")
result = client.forget("mem_01H...", hard=False)
print(result.was_already_forgotten, result.edges_removed)

Wire

The wire client takes a ForgetRequest. Build it with ForgetBuilder, which defaults to a soft forget:

token / mTLSstable
client.forget(request: ForgetRequest) -> ForgetResponse
from brain_db_sdk import BrainClient, Auth, ForgetBuilder

with BrainClient.connect("127.0.0.1", 9090, Auth.token(b"my-token")) as client:
    # Soft forget (tombstone + grace period).
    client.forget(ForgetBuilder(memory_id).build())

    # Hard forget (immediate zeroing).
    client.forget(ForgetBuilder(memory_id).hard().build())

ForgetBuilder knobs

OptionTypeDefault / Env
.hard()switch to hard forget

Zero the memory immediately, no grace period. Default is a soft tombstone.

.with_mode(mode)int

Set the forget mode explicitly (ForgetMode.SOFT / ForgetMode.HARD).

.act_as(namespace, agent_id)str, bytes

Run the forget as an effective identity. Requires can_act_as.

Response shape

FieldTypePresence
memory_idstr (HTTP) / int (wire)always

The forgotten memory's id.

was_already_forgottenboolalways

True when the memory was already gone — forget is idempotent, so this is a success, not an error.

edges_removedintalways

How many edges were removed as part of the forget cascade.

Forget on a missing or stale id is a no-op success (was_already_forgotten = True), not a NotFound. Soft forget respects a grace period before reclamation; hard forget zeroes immediately.

Was this page helpful?

On this page