Vector Stores: Pinecone, Qdrant, pgvector, Chroma, FAISS
Comparing managed and self-hosted stores (Pinecone, Qdrant, pgvector, Weaviate, Milvus, Chroma, FAISS), managed RAG from OpenAI and Google, HNSW and IVF index types, running Qdrant in Docker and pgvector in Postgres, when to choose what.
Pinecone (managed)
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
pc.indexes.create(
name="docs",
schema={"fields": {"embedding": {"type": "dense_vector", "dimension": 1536, "metric": "cosine"}}},
deployment={"deployment_type": "managed", "cloud": "aws", "region": "us-east-1"},
)
index = pc.index("docs")
index.documents.upsert(
namespace="kb",
documents=[{"_id": "d1", "embedding": vec, "src": "faq"}],
)
This code is for the pinecone Python SDK 10.x. The old pc.create_index(..., spec=ServerlessSpec(...)) call is kept for compatibility: it creates a classic vector index that you write to with upsert(vectors=...). Use pc.indexes.create for new code.
Pros: zero infrastructure, auto-scale, a free Starter plan (2 GB). Cons: cost as you grow, data at the vendor, vendor lock-in.
The rest of this lesson opens after a free sign-up
Sign up with email or Google: the first two lessons of every course stay open for good, and the whole catalog is open for 7 days. No card needed.


