Skip to main content
Use this page to check collection state, flush pending writes to disk, optimize storage after deletions, and rebuild indexes.
Install the Python client library: pip install actian-vectorai-client.

Get collection state

Use get_state() to retrieve the current VDE state for a collection.

Get collection statistics

Use get_stats() to inspect vector counts and storage usage.
get_stats() returns these fields.
  • total_vectors: Total number of vectors in the collection.
  • indexed_vectors: Number of vectors currently indexed.
  • deleted_vectors: Number of deleted vectors not yet reclaimed.
  • storage_bytes: Collection storage size in bytes.
  • index_memory_bytes: Index memory use in bytes.

Flush a collection

VectorAI DB writes data changes to disk asynchronously for performance. Flushing forces pending writes to be persisted immediately.

Optimize a collection

Optimization compacts storage and reclaims space from deleted vectors.

Rebuild an index

Use rebuild_index() for a simple rebuild. It returns true when the server accepts or completes the rebuild request.

Monitor rebuild progress

Use trigger_rebuild(wait=False) when you need a task ID and progress reporting.

List rebuild tasks

list_rebuild_tasks() returns a tuple containing the task list and the total count.
Each rebuild task includes these fields.
  • task_id: Unique identifier for the rebuild task.
  • collection_name: Name of the collection being rebuilt.
  • state: Current task state.
  • progress: Completion percentage from 0 to 100.
  • current_phase: Current rebuild phase.
  • started_at: Timestamp when the task started.

Complete maintenance workflow

The following example combines common maintenance operations into one workflow.