ComeçarComece de graça

Your first Pinecone index

With your Pinecone client initialized, you're all set to begin creating an index! Indexes are used to store records, including the vectors and associated metadata, as well as serving queries and other manipulations. As you progress through the course, you'll see how these different steps build up to a modern AI system built on a vector database.

If you accidentally create a valid index that doesn't meet the specifications detailed in the instructions, you'll need to add the following code before your .create_index() code to delete it and re-create it:

pc.delete_index('my-first-index')

The Pinecone class has already been imported for you.

Este exercício faz parte do curso

Vector Databases for Embeddings with Pinecone

Ver curso

Instruções do exercício

  • Import the ServerlessSpec class from pinecone.
  • Initialize the Pinecone connection using your API key.
  • Create a serverless index called "my-first-index" to hold vectors with 256 dimensions, and configure the index for the 'aws' cloud platform in the 'us-east-1' region.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Import ServerlessSpec
from pinecone import ____

# Initialize the Pinecone client with your API key
pc = Pinecone(api_key="____")

# Create your Pinecone index
pc.____(
    name="____",
    dimension=____,
    spec=____(
        cloud='____'
        region='____'
    )
)
Editar e executar o código