Skip to main content

How To List Pinecone Vectors

In this article, we will develop a Python script that can list all of the Vectors in a Pinecone namspace. In this example, we are going to list all of the vectors in index "langchain-test-index3", namespace "TestOne".

Procedure

  1. From the terminal install Pinecone
pip install "pinecone[grpc]"
  1. Create a text file called .env, within the text file create a variable PINECONE_API_KEY = followed by your Pinecone api key.

  2. Create a python script called pinecone-list-vectors.py

pinecone-list-vectors.py

  1. Execute the python from the terminal
python pinecone-list-vectors.py

The script will display the vectors, source and text meta data.

alt text

Adverts