1. Learn
  2. /
  3. Courses
  4. /
  5. Vector Databases for Embeddings with Pinecone

Connected

Exercise

Ingesting vectors with metadata

It's ingesting time! You'll be ingesting vectors, which is a list of dictionaries containing the vector values, IDs, and associated metadata. They're already been provided in a format that can be directly inserted into the index without further manipulation.

Here's another reminder about the structure of vectors.

vectors = [
    {
        "id": "0",
        "values": [0.025525547564029694, ..., 0.0188823901116848]
        "metadata": {"genre": "action", "year": 2024}
    },
        ...,
]

Instructions

100 XP
  • Initialize the Pinecone connection with your API key.
  • Connect to your index called "datacamp-index".
  • Upsert vectors to the index.
  • Print the index's descriptive statistics.