
Creating Vector Stores: Your Database of Meaning
Learn how to store embeddings efficiently. Introduction to ChromaDB and Pinecone for fast similarity search.
Creating Vector Stores
You generated embeddings in Module 6. Now, where do you put them? You need a Vector Database.
Popular Options
- ChromaDB: Open source, runs locally or in-memory. Great for testing and Python apps.
- Pinecone: Managed cloud service. Good for massive scale.
- pgvector: If you use PostgreSQL, this extension adds vector search.
Code Example (ChromaDB)
import chromadb
# 1. Setup client
client = chromadb.Client()
collection = client.create_collection("my_docs")
# 2. Add Documents (Chroma handles embedding call for you if configured, or pass vectors)
collection.add(
documents=["Doc 1 text...", "Doc 2 text..."],
metadatas=[{"source": "wiki"}, {"source": "news"}],
ids=["id1", "id2"]
)
# 3. Query
results = collection.query(
query_texts=["Search query"],
n_results=2
)
Summary
A Vector Store is just a database optimized for "Nearest Neighbor" math. It stores the Embedding Vector + The Original Text.
In the next lesson, we discuss Chunking.