Upserting Data with Embedding Models
Upstash Vector provides embedding models that can automatically generate vector embeddings for you.
You can read more about Embedding Models on our docs.
Upsert Data
We’ll use the upsertData()
method to instruct the SDK to upsert data that generates vectors from one of our embedding models, as demonstrated below:
You can also enhance your index by adding metadata, enabling more efficient filtering in the future.
You can read more about Metadata, Data and Metadata Filtering on our docs.
Upsert Data Many
Building on the previous section, Upstash Vector also supports generating multiple vectors at once.
To do this, we’ll use the upsertDataMany()
method, which enables you to efficiently insert or update multiple vectors in an index, as shown below:
Upserting multiple records simultaneously improves performance by allowing you to batch your imports efficiently.
Sparse Indexes & Hybrid Indexes
Sparse and hybrid indexes do not require a different API. They will generate their vectors and sparse vectors based on the models you selected when creating your vector index.
You can read more about Sparse Indexes and Hybrid Indexes on our docs.