Module persistence

Module persistence 

Source
Expand description

§Persistence Module

This module provides functionality for saving and loading collections to/from disk. It supports collection-level persistence with full override strategy.

§File Format

Collections are saved as JSON files with the following structure:

{
  "version": "1.0.0",
  "metadata": {
    "name": "collection_name",
    "created_at": "2025-01-21T10:00:00Z",
    "vector_count": 1000,
    "dimension": 768,
    "index_type": "HNSW"
  },
  "index": {
    // Serialized VectorIndexWrapper
  }
}

Structs§

CollectionData
Complete collection data structure for persistence
CollectionMetadata
Collection metadata for persistence
FileHeader
File header containing version and format information

Enums§

PersistenceError
Error types for persistence operations

Functions§

load_collection_from_file
Load a collection from a file
save_collection_to_file
Save a collection to a file