Offload vector infra to a managed service — low ops overhead, predictable latency, pay per usage.
A fully-managed warehouse. You ship pallets (vectors); they shelf, index, retrieve. No racking, no forklifts, no fire extinguishers.
pinecone.create_index('docs', dimension=1536, metric='cosine')
index.upsert(vectors=[(id, vec, metadata)])
index.query(vector=q, top_k=5, include_metadata=True)
index.delete(ids=[...])
Pinecone is the most popular managed vector database. Serverless tier scales to zero; pod-based tier gives dedicated capacity. Common operations: create_index, upsert, query, delete, fetch_by_id. Metadata filtering happens inside Pinecone. Use it when you want zero operational overhead and predictable p99 latency.
from pinecone import Pinecone, ServerlessSpec
pc = Pinecone(api_key='...')
pc.create_index('docs', dimension=1536, metric='cosine',
spec=ServerlessSpec(cloud='aws', region='us-east-1'))
Serverless spec eliminates capacity planning; you pay per read and write.
index = pc.Index('docs')
index.upsert(vectors=[('chunk-1', vec, {'source':'pdf','tenant':'acme'})])
print(index.query(vector=q, top_k=5, include_metadata=True, filter={'tenant':'acme'}))
Metadata filter is server-side; filter and vector query happen in one round-trip.
# namespace isolation
index.upsert(vectors=[...], namespace='tenant-acme')
index.query(vector=q, namespace='tenant-acme', top_k=5)
Namespaces are isolated indexes within one index — per-tenant isolation without per-tenant index.
Embedding models with mismatched dimensions. Pinecone index is fixed-dimension; switching embed models triggers a re-create.
Pinecone is the easy-on ramp. Serverless scales, namespaces isolate tenants, metadata filtering is server-side. Pin your embed-model dimension.
{"source":"pdf"} returned 0 rows; expected several.