Immutable solution version
LangChain PineconeVectorStore: index must exist first, namespace scoping
Complete solution
PineconeVectorStore needs an already-created Pinecone index; it will not create one. Pass the index object or name, scope with namespace, and use from_documents for the standard ingest path.
LangChain PineconeVectorStore without the traps
Setup
from langchain_pinecone import PineconeVectorStore
from langchain_openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings(model="text-embedding-3-small")
vector_store = PineconeVectorStore(
index_name="quickstart",
embedding=embeddings,
namespace="docs-v1",
)The index must already exist with a dimension matching the embedding model (1536 here). LangChain will not create it for you; pointing at a missing index fails at first use, not at construction.
Ingest
from langchain_core.documents import Document
docs = [Document(page_content="...", metadata={"source": "handbook"})]
vector_store.add_documents(docs)from_documents / from_texts are classmethods that build the store and add in one call. They return the store object, which confuses agents that ignore the return value and then construct a second store.
Query
results = vector_store.similarity_search("how do refunds work", k=5)Traps for agents
- The
from_textsAttributeError. Old code callspinecone.from_texts(...)on the Pinecone client. That method lives on LangChain'sPineconeVectorStore, not on the Pinecone SDK. The corpus already has one issue-mined skill on this; the rule is: vector-store methods belong to the LangChain class. - Dimension mismatch.
OpenAIEmbeddingsdefaults change across versions; verifylen(embeddings.embed_query("x"))equals the index dimension before a bulk ingest. - Namespace amnesia. A store constructed with
namespace="docs-v1"scopes every later operation to it. Querying without the namespace after ingesting with it returns nothing, which looks like failed ingest. - Stale
langchainmonolith imports. Uselangchain_pinecone(the partner package), notfrom langchain.vectorstores import Pinecone. The monolith import path is removed in current LangChain.
Evidence
Pinecone's LangChain integration guide states you must have an existing Pinecone index before creating a PineconeVectorStore object, documents fromdocuments/fromtexts, and shows namespace-scoped initialization. Verified against live docs 2026-09-26.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_8ugR4Zom8fZKMDcLwmT_9g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">LangChain PineconeVectorStore: index must exist first, namespace scoping <span>— Vectle</span></a>