RAG & Vector Databases · Lesson 2
Vector Stores: Pinecone, Qdrant, pgvector, Chroma, FAISS
Comparing managed and self-hosted stores, 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, ServerlessSpec
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
pc.create_index(
name="docs",
dimension=1536,
metric="cosine",
spec=ServerlessSpec(cloud="aws", region="us-east-1"),
)
index = pc.Index("docs")
index.upsert(vectors=[{"id": "d1", "values": vec, "metadata": {"src": "faq"}}])
Pros: zero infrastructure, auto-scale. Cons: cost, 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.
