EncryptedIndex bound to it.
There is one index type, configured with flat fields. The earlier
IndexIVFFlat, IndexIVFPQ, and IndexIVFSQ types and the indexConfig argument no longer exist.Parameters
Key management
Pass exactly one ofindexKey or kmsName. The service rejects both together with CyborgDBValidationError (HTTP 400), whatever the KMS provider.
- SDK-supplied KEK: pass
indexKey. Supply the same key again on everyloadIndex(). - KMS-backed: pass
kmsName. The service generates the key, wraps it with the named provider, and stores the wrapped key. Later calls omitindexKey.
Storage precision
storagePrecision sets the format used to store the index’s vector embeddings. Every value works with every metric.
The
tq* values are TurboQuant tiers; lower tiers use less storage in exchange for a small recall and latency cost.
Metadata schema
metadataSchema sets how each metadata field is indexed. Metadata itself stays schemaless: this controls indexing, not what may be stored. Fields left out get the default policy (indexed and filterable). Nested fields use dot-paths such as 'loc.city'.
MetadataFieldPolicy type):
Filters the index cannot answer
The index can answer a filter when the field is filterable and, for$regex or $contains, the field also has pattern set. Any other filter is handled differently depending on the call:
With the schema above:
metadataSchema() getter.
Returns
Promise<EncryptedIndex> bound to the new index. For KMS-backed indexes it holds no plaintext key.
Exceptions
CyborgDBValidationError
CyborgDBValidationError
- Neither
indexKeynorkmsNameis passed, orindexKeyis not 32 bytes. Thrown before any request is sent. - The service rejects the request (HTTP
400/422): the index name already exists, bothindexKeyandkmsNamewere passed, thekmsNameslot is unknown,storagePrecisionisn’t one of the six values, ormetadataSchemacombines settings that aren’t allowed.
CyborgDBAuthenticationError
CyborgDBAuthenticationError
The client’s
apiKey is missing or invalid (HTTP 401), or is a per-user key: creating an index requires the root key (HTTP 403).CyborgDBServiceError
CyborgDBServiceError
The service returns
5xx, including KMS wrap failures (502).CyborgDBTransportError
CyborgDBTransportError
The service can’t be reached.
Example Usage
SDK-supplied key
Store
indexKey securely: it is needed to load the index again. See Generate Key.