New projects should use the Documents API. To move an existing index, see Move to the Documents API.
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
namefor the index. - Set the
vector_typetodense. - Specify the
dimensionand similaritymetricof the vectors you’ll store in the index. This should match the dimension and metric supported by your embedding model. - Set
spec.cloudandspec.regionto the cloud and region where the index should be deployed. For Python, you also need to import theServerlessSpecclass.
Sparse vectors
If you use an external embedding model to convert your data to sparse vectors, create an index as follows:- Provide a
namefor the index. - Set the
vector_typetosparse. - Set the distance
metrictodotproduct. Indexes that store sparse vectors don’t support other distance metrics. - Set
spec.cloudandspec.regionto the cloud and region where the index should be deployed.
Wait for the index to be ready
A new index can’t accept data until itsstatus.ready field is true. See Wait for the index to be ready.