forget
Remove a memory — the soft tombstone, the hard zero, and why a repeat call is safe.
async fn forget(&self, input: &ForgetInput) -> Result<ForgetResult, BrainHttpError>async fn forget(&self, request: &ForgetRequest) -> Result<ForgetResponse>Parameters
memory_idstring (wire: 64-bit integer)requiredThe memory to forget. An id that does not exist is not an error — see the result below.
hardbooleanoptionalfalse (the default) tombstones the memory: it stops being readable and stops matching recall, and the record stays. true zeroes the stored bytes. On the wire this is a ForgetMode — Soft (0) or Hard (1).
Returns
memory_idstring (wire: 64-bit integer)alwaysThe id you passed back.
was_already_forgottenbooleanalwaystrue when the memory was already gone. The call still succeeds — this is what makes forget safe to retry, and safe to call from a cleanup job that does not track what it has already removed.
edges_removedintegeralwaysHow many memory edges were detached along with it.
Example
let res = brain.forget(&ForgetInput { memory_id: memory_id.clone(), hard: Some(false) }).await?;
if !res.was_already_forgotten {
println!("removed, detaching {} edges", res.edges_removed);
}Hard is not undoable
A hard forget overwrites the stored text. There is no restore, no grace period, and no audit record that can reconstruct it. Use the soft mode unless you are servicing an erasure request.
Forgetting a memory does not retract the statements extracted from it. Those have their own lifecycle — see retract_statement.
ForgetBuilder
use brain_db_sdk::ForgetBuilder;
let request = ForgetBuilder::new(memory_id).hard().build();
client.forget(&request).await?;Was this page helpful?