> ## 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.

# prune

> Clean up data and system resources

# cognee.prune

Static class with methods for cleaning up Cognee data and system state.

## Methods

### prune.prune\_data()

```python theme={null}
await cognee.prune.prune_data()
```

Removes all raw data files from the file storage backend (local disk or S3,
configured via `DATA_ROOT_DIRECTORY`). Does **not** remove database records —
use `prune_system(metadata=True)` for that.

### prune.prune\_system()

```python theme={null}
await cognee.prune.prune_system(
    graph: bool = True,
    vector: bool = True,
    metadata: bool = False,
    cache: bool = True,
)
```

Cleans up system database resources selectively. Does **not** delete files
from storage — call `prune_data()` first if you also need to wipe raw files.

<ParamField path="graph" type="bool" default="True">Delete all data from the graph database (e.g., Kuzu, Neo4j).</ParamField>
<ParamField path="vector" type="bool" default="True">Delete all data from the vector store (e.g., LanceDB, Qdrant).</ParamField>
<ParamField path="metadata" type="bool" default="False">Delete the relational metadata database (datasets, data records, pipeline state). Defaults to `False` to prevent accidental loss of metadata.</ParamField>
<ParamField path="cache" type="bool" default="True">Clear pipeline caches.</ParamField>

<Warning>
  `prune_system` has no permission checks and will wipe **all** graph and vector
  data regardless of which user or dataset it belongs to. Only use it in local
  development or test environments.
</Warning>

## Examples

```python theme={null}
import cognee

# Full reset: remove raw files, databases, and metadata
await cognee.prune.prune_data()           # wipes raw files from disk / S3
await cognee.prune.prune_system(metadata=True)  # wipes graph, vector, relational DB, and cache

# Partial reset: clear graph and vector stores only (keep metadata and files)
await cognee.prune.prune_system(graph=True, vector=True, metadata=False, cache=False)

# Clear only the pipeline cache
await cognee.prune.prune_system(graph=False, vector=False, metadata=False, cache=True)
```
