Skip to main content
New projects should use the Documents API. To move an existing index, see Move to the Documents API.
A legacy vector index stores dense or sparse vectors that you generate with an external embedding model, and it’s read and written through the legacy Vectors API. To store vectors in a document index instead, declare a dense_vector or sparse_vector field. See Create a document index.

Dense vectors

If you use an external embedding model to convert your data to dense vectors, create an index as follows:
  • Provide a name for the index.
  • Set the vector_type to dense.
  • Specify the dimension and similarity metric of the vectors you’ll store in the index. This should match the dimension and metric supported by your embedding model.
  • Set spec.cloud and spec.region to the cloud and region where the index should be deployed. For Python, you also need to import the ServerlessSpec class.
Other parameters are optional. See Create an index for details.

Sparse vectors

If you use an external embedding model to convert your data to sparse vectors, create an index as follows:
  • Provide a name for the index.
  • Set the vector_type to sparse.
  • Set the distance metric to dotproduct. Indexes that store sparse vectors don’t support other distance metrics.
  • Set spec.cloud and spec.region to the cloud and region where the index should be deployed.
Other parameters are optional. See Create an index for details.

Wait for the index to be ready

A new index can’t accept data until its status.ready field is true. See Wait for the index to be ready.