Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Vector Databases for Embeddings with Pinecone

Cursus bekijken

Oefeninstructies

  • 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.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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='____'
    )
)
Code bewerken en uitvoeren