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 ofindex_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, omitkms_name. The server records the index withprovider: none; you must re-supply the same key on every subsequent call (load_index,query,upsert, etc.). - KMS-backed — pass
kms_name, omitindex_key. The server generates the DEK, wraps it under the named registry slot, and persists the envelope. Subsequent calls omitindex_keyentirely.
Returns
An instance ofEncryptedIndex bound to the newly created index. For KMS-backed indexes the returned handle holds no plaintext key.
Exceptions
ValueError
ValueError
- Raised if neither
index_keynorkms_nameis provided. - Raised if
index_keyis provided but is not exactly 32 bytes. - Raised by the server (re-wrapped as
ValueError) if bothindex_keyandkms_nameare 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.
Service Errors
Service Errors
- 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.