Skip to main content

agrag.ingestion.community.delete_all_communities

delete_all_communities(graph_store:GraphStore | GraphStoreTransaction, *, batch_size:int = _DEFAULT_DELETE_BATCH_SIZE) -> None

Delete every Community node and its edges, in batches.

Repeats the bounded delete until a batch reports fewer than batch_size rows deleted.

Parameters:

  • graph_store (GraphStore | GraphStoreTransaction) – Where the delete runs. Accepts either a GraphStore or a GraphStoreTransaction handle so a caller inside store.transaction() can delete and rewrite communities atomically.
  • batch_size (int) – Community nodes deleted per statement.