Skip to main content
Adds new vectors to the encrypted index or updates existing vectors if they have the same ID. This operation is the primary method for populating an index with vector data.

Parameters

VectorItem Structure

Each VectorItem must contain an id and may optionally include vector, contents, and metadata:

Returns

Promise<SuccessResponseModel>: A Promise that resolves to a success response object containing the operation status and message with the count of upserted vectors.

Exceptions

  • Throws if the API request fails due to network connectivity issues.
  • Throws if authentication fails (invalid API key).
  • Throws if the encryption key is invalid for the specified index.
  • Throws if there are internal server errors preventing the upsert.
  • Throws if the items array is empty or contains invalid data.
  • Throws if vector dimensions don’t match the index configuration.
  • Throws if required fields are missing from vector items.
  • Throws if item IDs contain invalid characters or are too long.

Example Usage

Basic Vector Upsert

Updating Existing Vectors

Upsert with Content & Metadata