Skip to main content

cognee.prune

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

Methods

prune.prune_data()

await cognee.prune.prune_data()
Removes all user data (datasets, ingested documents) while keeping system configuration intact.

prune.prune_system()

await cognee.prune.prune_system(
    graph: bool = True,
    vector: bool = True,
    metadata: bool = False,
    cache: bool = True,
)
Cleans up system resources selectively.
graph
bool
default:"True"
Remove all graph database data.
vector
bool
default:"True"
Remove all vector store data.
metadata
bool
default:"False"
Remove metadata/relational database data.
cache
bool
default:"True"
Clear pipeline caches.

Examples

import cognee

# Full reset: remove everything
await cognee.prune.prune_data()
await cognee.prune.prune_system(metadata=True)

# Just clear graph and vector stores (keep metadata)
await cognee.prune.prune_system(graph=True, vector=True, metadata=False)