Skip to main content
Creates and returns an EncryptedIndex instance backed by a new encrypted DiskIVF index on the server.
v0.17 introduces a single DiskIVF index type and removes the polymorphic index_config argument. The previous IndexIVFFlat, IndexIVFPQ, and IndexIVFSQ types are gone — index configuration is now expressed as flat keyword arguments (dimension, metric, storage_precision).

Parameters

Key Management Modes

At least one of index_key / kms_name must be supplied; supplying both against a real-KMS slot is rejected by the server with 400:
  • SDK-supplied KEK — pass index_key, omit kms_name. The server records the index with provider: none; you must re-supply the same key on every subsequent call (load_index, query, upsert, etc.).
  • KMS-backed — pass kms_name, omit index_key. The server generates the DEK, wraps it under the named registry slot, and persists the envelope. Subsequent calls omit index_key entirely.

Returns

An instance of EncryptedIndex bound to the newly created index. For KMS-backed indexes the returned handle holds no plaintext key.

Exceptions

  • Raised if neither index_key nor kms_name is provided.
  • Raised if index_key is provided but is not exactly 32 bytes.
  • Raised by the server (re-wrapped as ValueError) if both index_key and kms_name are provided against a real-KMS slot.
  • Raised by the server if the index name already exists, the embedding model is unsupported, or the KMS slot lookup fails.
  • Raised if the CyborgDB service is unavailable, unreachable, or returns 5xx (including KMS-wrap failures as 502).

Example Usage

SDK-supplied key (basic)

For more info on generate_key, refer to Generate Key.

SDK-supplied key with explicit dimension

KMS-backed index

Auto-embedding

Float16 storage for reduced footprint

For more info on auto-generating embeddings, refer to Auto-Generate Embeddings.