What is the forget operation
forget is the delete entry point of the memory API. It removes memory at the scope you name and keeps the stores consistent with each other.
What happens under the hood
Removes memory: a whole dataset, a specific data item, or everything. Cascades across the relational, graph, and vector backends and file storage. rustdoc:api::forget.
What you can forget
The Rust API takes aForgetTarget (cognee::api::forget):
A dataset is named by
DatasetRef::Name or DatasetRef::Id. Either way it must be the owner’s dataset in the caller’s tenant: a name never reaches a dataset in another tenant, and an id of another owner’s dataset fails as Dataset <id> not found, the same answer as an unknown id. The resolved dataset is then deleted by id.
forget is a thin wrapper over DeleteService (cognee-delete) and always deletes in soft mode: the data, its chunks and their graph and vector entries are removed, but entity nodes left orphaned by the deletion are not swept. To sweep them, use delete in hard mode (cognee-cli delete --mode hard, or DeleteMode::Hard on DeleteService). The returned ForgetResult carries a target label and the DeleteResult.
The CLI’s cognee-cli forget takes --dataset-name (-d), --data-id (needs --dataset-name) or --all, plus --tenant-id. The bindings’ forget takes a target object whose kind is item, dataset or all; any other kind is rejected. The memory-only targets are available from the Rust API only. For a dry-run preview of what a delete would remove, use delete directly.
delete
The lower-level delete behindforget cascades removal of data and datasets across relational → graph → vector → file storage, with a dry-run preview. Entry: DeleteService in cognee-delete; CLI cognee-cli delete, bindings delete*().
Related
Datasets
The scope forget works in
Remember
Store memory
Operations
Every operation and interface