DBConfig
TheDBConfig class specifies the storage location for the index, with options for in-memory storage, databases, or file-based storage.
Parameters
The supported
location options are:
"rocksdb": Use for persistent local storage with no network dependency (recommended for embedded/local deployments)."redis": Use for high-speed, in-memory storage (recommended forindex_location)."postgres": Use for reliable, SQL-based storage (recommended forconfig_location)."memory": Use for temporary in-memory storage (for benchmarking and evaluation purposes)."threadsafememory": Use for thread-safe in-memory storage (for multi-threaded benchmarking and evaluation).
Example Usage
GPUConfig
TheGPUConfig class configures which operations should use GPU acceleration. GPU acceleration requires CUDA support.
Parameters
Properties (Read-Only)
Example Usage
DistanceMetric
DistanceMetric is a string representing the distance metric used for the index. Options include:
"cosine": Cosine similarity."euclidean": Euclidean distance."squared_euclidean": Squared Euclidean distance.
IndexConfig
TheIndexConfig class defines the parameters for the type of index to be created. Each index type (e.g., ivf, ivfflat, ivfpq) has unique configuration options: