Pinecone¶
Pinecone is a fully managed cloud vector database. It requires an embedder because you supply the dense vectors.
When should you use this?¶
Use it when your production RAG runs on Pinecone's managed infrastructure.
Prerequisites¶
- Install the client:
- An embedder (e.g.
sentence_transformers) — required. - A Pinecone account and an existing index.
Step 1 — Install¶
Step 2 — Set your API key¶
Step 3 — Configure¶
config.yaml
retriever:
provider: pinecone
settings:
index_name: my-index
api_key: ${PINECONE_API_KEY}
# namespace: production # optional
embedder:
provider: sentence_transformers
model: all-MiniLM-L6-v2
Step 4 — Run¶
Python SDK example¶
eval_pinecone.py
import asyncio
from openagent_eval.config.models import Config, RetrieverConfig, EmbedderConfig
from openagent_eval.core.engine import Engine
config = Config(
dataset={"path": "data/questions.json"},
llm={"provider": "mock"},
retriever=RetrieverConfig(
provider="pinecone",
settings={"index_name": "my-index", "api_key": "pc-..."},
embedder=EmbedderConfig(
provider="sentence_transformers", model="all-MiniLM-L6-v2"
),
),
metrics={"retrieval": ["context_precision", "context_recall", "mrr"]},
)
engine = Engine(config)
report = asyncio.run(engine.run(dataset))
print(report.summary["metrics_summary"])
All configuration options¶
| Option | Type | Default | Description |
|---|---|---|---|
index_name |
str |
— | Required. Pinecone index. |
embedder |
Embedder |
— | Required. |
api_key |
str \| null |
null |
Falls back to PINECONE_API_KEY. |
environment |
str \| null |
null |
Legacy index environment. |
namespace |
str \| null |
null |
Optional index namespace. |
Troubleshooting¶
ProviderConnectionError: embedder is required— addretriever.embedder.- Auth error — set
PINECONE_API_KEYor passapi_key. - Index not found — confirm
index_nameexists in your Pinecone project.
Related¶
- Choose an embedder in ../embedders/index.md.
- Pair with an LLM from ../llm/index.md.