Usage
Parameters
Pinecone index name. First positional argument.
Pinecone API key. Falls back to
PINECONE_API_KEY.OpenAI API key used for creating embeddings. Falls back to
OPENAI_API_KEY.OpenAI embedding model for both indexing and retrieval.
Environment variables
Embedding models
| Model | Dimensions | Notes |
|---|---|---|
text-embedding-3-large | 3072 | Default. Best quality. |
text-embedding-3-small | 1536 | Lower cost, still good quality. |
text-embedding-ada-002 | 1536 | Legacy baseline. |
Creating a Pinecone index
- Go to app.pinecone.io
- Create a Serverless index:
- Dimensions:
3072(fortext-embedding-3-large) - Metric:
cosine - Cloud/Region: choose based on your API server location
- Dimensions:
- Copy the index name and your API key to
.env
Namespaces
Use namespaces to partition a single index into logical sections:Pinecone instance. For multi-namespace retrieval, you need separate LangChat instances or a custom adapter.