Learn/LangChain Mastery/Part 5 · 4. Embeddings & Vector Stores
Lesson 33 of 68
SyllabusLangChain Mastery · Part 5

Vector Stores: FAISS, Chroma

Where the numbers live. Indexing vs Brute Force.

Course outline & contents
LangChain Mastery
Embeddings: What Matters in PracticeEmbedding Models in LangChainVector Stores: FAISS, ChromaPersisting & Reloading IndexesMetadata FilteringDense vs Sparse (BM25 Overview)Hybrid Search Concepts

It is a specialized database. It stores:

  1. Vector (Index)
  2. Metadata (Filter)
  3. Content (Payload)

We use it because SQL databases are too slow for vector math.

If you have 1 million vectors, comparing your query to every single one (Brute Force) is slow. Vector stores use ANN (Approximate Nearest Neighbor) indexing. They group similar vectors into clusters. When you search, they only check the relevant cluster. Trade-off: You gain Speed (100x), you lose Recall (1-5% errors).

  • Pros: Incredibly fast. Runs on GPU. The rigorous standard.
  • Cons: Hard to use. No metadata filtering natively (without wrappers). In-memory only (usually).
  • Pros: Developer friendly. "Just works." Handles metadata/storage/embedding for you.
  • Cons: Newer, less optimized for massive scale (yet).

They share the same interface.

chroma_usage.py
from langchain_community.vectorstores import Chroma

# Add
db = Chroma.from_documents(docs, embedding_model)

# Search
results = db.similarity_search("How do I reset password?")

For < 100k docs, use Chroma/FAISS locally. For > 1M docs, use Pinecone/Weaviate/Milvus. The logic is the same: Index vectors to find neighbors fast.

Key Intuition: "It's a map of meaning, not a list of keywords."

Track your progressSign in and your progress follows you across devices.
Sign in to track progress Next lesson
← Previous lessonEmbedding Models in LangChainNext lesson →Persisting & Reloading Indexes