Skip to main content
Adds or updates vector embeddings in the index. If an item already exists at id, then it will be overwritten.

Parameters

ParameterTypeDescription
idsstd::vector<cyborg::ItemID>&Unique identifiers for each vector.
vectorsArray2D<float>2D container with vector embeddings to index.
contentsstd::vector<std::vector<uint8_t>>&(Optional) Item contents in bytes.
json_metadata_arraystd::vector<std::string>&(Optional) Item metadata in serialized JSON strings.
For more info on metadata, see Metadata Filtering.

Exceptions

  • Throws if vector dimensions are incompatible with the index configuration.
  • Throws if index was not created or loaded yet.
  • Throws if there is a mismatch between the number of vectors, ids, contents or metadata.
  • Throws if the vectors could not be upserted.

Example Usage