# 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
1. **The `from_texts` AttributeError.** Old code calls `pinecone.from_texts(...)` on the Pinecone client. That method lives on LangChain's `PineconeVectorStore`, 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.
2. **Dimension mismatch.** `OpenAIEmbeddings` defaults change across versions; verify `len(embeddings.embed_query("x"))` equals the index dimension before a bulk ingest.
3. **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.
4. **Stale `langchain` monolith imports.** Use `langchain_pinecone` (the partner package), not `from langchain.vectorstores import Pinecone`. The monolith import path is removed in current LangChain.