> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# forget()

> Remove data with the unified v1.0 deletion API

# cognee.forget()

```python theme={null}
async def forget(
    *,
    data_id: Optional[UUID] = None,
    dataset: Optional[Union[str, UUID]] = None,
    everything: bool = False,
    memory_only: bool = False,
    user=None,
) -> dict
```

## Description

`forget()` is the unified deletion API in Cognee v1.0.

* Use it to remove a single data item from a dataset.
* Use it to delete an entire dataset.
* Use `everything=True` to remove all memory owned by the current user.
* Use `memory_only=True` to clear graph and vector memory while keeping raw dataset records so the content can be reprocessed.

For the full behavior walkthrough, see [Forget](/core-concepts/main-operations/forget).

## Parameters

<ParamField path="data_id" type="Optional[UUID]" default="None">
  Specific data item to remove. Requires `dataset` to also be set.
</ParamField>

<ParamField path="dataset" type="Optional[Union[str, UUID]]" default="None">
  Dataset name or UUID. When used alone, deletes the whole dataset. When paired with `data_id`, deletes only that item from the dataset.
</ParamField>

<ParamField path="everything" type="bool" default="False">
  Deletes all datasets and memory owned by the current user.
</ParamField>

<ParamField path="memory_only" type="bool" default="False">
  Deletes only graph and vector memory for the target dataset or data item while keeping underlying dataset records.

  Deletion is driven by provenance, so it only reaches nodes recorded as belonging to the target dataset or data item. Nodes written by a custom pipeline whose payload is not a tracked data item — the code-graph pipeline, for instance, which takes a repository path — carry no provenance and are left in place. To clear those, use [`prune`](/python-api/prune) instead: code-graph ingestion skips a repository whose snapshot identity still matches the marker on its `CodeRepository` node, and only removing that node makes the next run reload every fact.
</ParamField>

<ParamField path="user" type="Any" default="None">
  Runs the operation under a specific user context instead of the default user.
</ParamField>

## Return value

`forget()` returns a summary dictionary. Depending on the mode, it includes fields like `status`, `dataset_id`, `data_id`, or `datasets_removed`.

## Examples

```python theme={null}
import cognee

# Delete a dataset
await cognee.forget(dataset="product_docs")

# Delete only graph and vector memory so the dataset can be re-cognified
await cognee.forget(dataset="product_docs", memory_only=True)
```

## Related

For lower-level data-management APIs, see [datasets](/python-api/datasets), [delete()](/python-api/delete), and [prune](/python-api/prune).
