Omnigraph
CLI

cleanup

Reclaim storage by removing old Lance versions (destructive).

cleanup removes manifests. And the fragments unique to those manifests, older than a retention policy. It is destructive: once a Lance version is removed, its data cannot be read via --snapshot. The command runs in preview mode unless --confirm is passed.

Usage

omnigraph cleanup <path> --keep <N> [--older-than <duration>] --confirm [options]

Arguments

ArgumentRequiredDescription
pathyesGraph URI (local path or s3://); required unless resolved from --target / --config

Options

OptionRequiredDefaultDescription
--keepone of --keep / --older-thanNumber of recent Lance versions to retain per table
--older-thanone of --keep / --older-thanOnly remove versions older than this duration (Go-style: 7d, 24h, 90m, 2w)
--confirmyes (to actually delete)Required to run the deletion. Without it, the command prints what it would remove
--targetnoNamed graph from omnigraph.yaml
--confignoPath to an omnigraph.yaml
--jsonnoOutput stats as JSON

At least one of --keep or --older-than must be supplied. When both are set, both must hold for a version to be eligible for removal.

Recovery floor. Keep at least 3

--keep lower than 3 is unsafe. The open-time recovery sweep can roll a branch back to the manifest-pinned version of an affected table, which is typically HEAD-1 (and occasionally further back) during a Phase B → Phase C drift. If --keep drops below 3, recovery may target a version that has already been garbage-collected, breaking the branch open.

The shipped default of --keep 10 is safe for normal use.

Output

For each table the command returns TableCleanupStats:

FieldDescription
table_keyThe node or edge type whose storage was inspected
bytes_removedDisk space freed for that table
old_versions_removedNumber of Lance versions deleted

Example

Preview a cleanup without making changes:

omnigraph cleanup ./graph.omni --keep 10 --older-than 30d

Run the cleanup for real:

omnigraph cleanup ./graph.omni --keep 10 --older-than 30d --confirm

Use the JSON output for monitoring or capacity-planning automation:

omnigraph cleanup ./graph.omni --keep 10 --confirm --json

On this page