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
- From the terminal install Pinecone
pip install "pinecone[grpc]"
-
Create a text file called
.env, within the text file create a variablePINECONE_API_KEY =followed by your Pinecone api key. -
Create a python script called
pinecone-list-vectors.py
- Execute the python from the terminal
python pinecone-list-vectors.py
The script will display the vectors, source and text meta data.
