Error during upsert with Langchain

Hello @patrick1 and thank you for the response!

I wrote my previous post via my phone and I was worried I didn’t get enough information in the post to get a response! Thank you for your guidance. I had tried to run the PineconeVectorStore class outside of the loop in the past and I don’t know why I decided to instantiate it inside the loop, lol. I’ll move it outside the loop and see if that’s the issue.

Edit / Update 1: I’m running it right now. I’ll update shortly.

One thing I noticed in your response is that you used: PineconeVectorStore(index_name=index_name, embedding=embeddings).

In the past I had used PineconeVectorStore(index=index_name, embedding=embeddings) and kept receiving errors. I think that caused me to rethink my code and thus somehow I ended up putting the class inside the loop (dumb I know).

I’ve now learned that using index=index_name vs index_name=index_name makes a big difference when instantiating the PineconeVectorStore class. I’m only posting this in case someone else has this issue in the future.

PineconeVectorStore(index_name=index_name, embedding=embeddings) allows for the class to take a string as an index name.

I assume PineconeVectorStore(index=index_name, embedding=embeddings) expects the index_name variable to be a Pinecone index class such as pc.Index("indexName")?

Thanks again. I’ll post an update again shortly.

Edit / Update 2: Everything worked as intended and my issue is resolved!
I was able to upsert 4,184 vectors without an issue once I made that small change of shifting the instantiation of the PineconeVectorStore class out of the loop, lol.

Thanks again for the assistance.