Create an index
This page shows you how to create different types of indexes in Pinecone.
You can create an index using the Pinecone console.
Create a serverless index
You can create a serverless index designed for integrated or external vector embedding:
-
Integrated embedding: In this case, you upsert and search with your source text, and Pinecone uses a hosted embedding model to convert the text to vectors automatically.
-
External embedding: In this case, you use an external embedding model to convert your data to vectors, and then you upsert and search with those vectors directly.
This feature is in public preview.
To create a serverless index with integrated embedding, use the create_for_model
operation as follows:
- Provide a
name
for the index. - Set
embed.model
to one of Pinecone’s hosted embedding models. - Set
spec.cloud
andspec.region
to the cloud and region where the index should be deployed. - Set
embed.field_map
to the name of the field in your source document that contains the data for embedding.
Other parameters are optional. See the API reference for details.
The response will look like this:
Create a pod-based index
To create a pod-based index, import the PodSpec
class and use the spec
parameter to define the environment where the index should be deployed, the pod type and size to use, and other index characteristics:
For the full list of parameters available to customize an index, see the create_index API reference.
Create an index from a backup or collection
You can create a serverless index from a backup or collection or a pod-based index from a collection. For more details, see Restore an index.
Prevent index deletion
When creating an index, you can protect the index from accidental deletion by setting the deletion_protection
parameter to enabled
. For more details, see Prevent index deletion.
Tag an index
When creating an index, you can tag the index to help with index organization and management. For more details, see Tag an index.
Was this page helpful?