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. The polymorphic IndexIVFFlat / IndexIVFPQ / IndexIVFSQ types and the indexConfig argument have been removed — index configuration is now expressed as flat keyword arguments (dimension, metric, storagePrecision).

Parameters

Key Management Modes

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

Returns

Promise<EncryptedIndex>: A Promise that resolves to a handle bound to the newly created index.

Exceptions

  • Throws if neither indexKey nor kmsName is provided.
  • Throws if indexKey is provided but is not exactly 32 bytes.
  • Throws if the index name already exists on the server.
  • Throws if the embedding model is not supported by the server.
  • Throws if both indexKey and kmsName are provided against a real-KMS slot (rejected by the server with 400).
  • Throws if the CyborgDB service is unavailable or unreachable.
  • Throws on 5xx responses, including KMS-wrap failures (502).

Example Usage

SDK-supplied key

For more info on generateKey, refer to Generate Key.

KMS-backed index

With embedding model

Float16 storage for reduced footprint

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