Title: ValueError with langchain_community.vectorstores Pinecone Integration
Hi everyone,
I’m getting this error when trying to initialize a Pinecone vector store using the community package:
ValueError: client should be an instance of pinecone.Index, got <class 'pinecone.data.index.Index'>
Here’s my current code:
from langchain_community.vectorstores import Pinecone as LangChainPinecone
dense_retriever = LangChainPinecone.from_existing_index(
index_name="sage",
embedding=embeddings,
namespace=namespace
).as_retriever(search_kwargs={"k": top_k})
I notice there are different ways to initialize Pinecone with LangChain. Could someone help clarify:
What’s causing this specific error?
Is there a difference between using langchain_community.vectorstores
vs langchain_pinecone
?
Thanks in advance!
hisham
February 20, 2025, 1:04pm
2
Having the same issue but with slightly different syntax
vectorstore = LangchainPinecone(index, embed, text_field, namespace)
Hello @hisham and @alejogbravo ,
Welcome to the community. Can you both share the version of LangChain and Pinecone you are using? The output of pip list
might be the easiest way to do it.
hisham
February 21, 2025, 2:44pm
4
Hi @patrick1
pinecone-client 5.0.1
pinecone-plugin-interface 0.0.7
langchain 0.3.7
langchain-community 0.3.5
langchain-core 0.3.37
langchain-openai 0.3.6
langchain-text-splitters 0.3.2
langsmith 0.1.140
hisham
February 21, 2025, 2:44pm
5
Let me know if you want me to paste the entire pip list
here
Hi Patrick, I’m getting the same error with this code:
vector_store = Pinecone.from_documents(chunks, embeddings, index_name=index_name)
this is my pip list:
Package Version
--------------------------------- ------------------
aext-assistant 4.0.15
aext-assistant-server 4.0.15
aext-core 4.0.15
aext-core-server 4.0.15
aext-panels 4.0.15
aext-panels-server 4.0.15
aext-share-notebook 4.0.15
aext-share-notebook-server 4.0.15
aext-shared 4.0.15
aiobotocore 2.12.3
aiohappyeyeballs 2.6.1
aiohttp 3.10.11
Thank you
1 Like