Module 10 Lesson 3: Vector Stores
·AI & LLMs

Module 10 Lesson 3: Vector Stores

The AI's database. Where to store and how to query millions of AI vectors locally.

Vector Stores: The Library Shelves

Once you have turned your text into vectors (lists of numbers), you need a place to put them. You can't just put them in a standard Excel sheet or a SQL database easily. You need a Vector Store.

1. Why a special database?

Standard databases are designed to search for text: "FIND the row where Name = 'Sudeep'". Vector databases are designed to search for math: "FIND the top 5 rows where the vector is NEAREST to [0.1, 0.4, -0.9]".


2. Popular Local Vector Stores

ChromaDB (Best for Beginners)

  • Format: Open Source, Python-friendly.
  • Advantage: It's "In-memory." You don't need to install a server. Just pip install chromadb and it creates a folder on your SSD.
  • Integration: Works perfectly with Ollama.

FAISS (High Performance)

  • Created by: Meta.
  • Advantage: Extremely fast for massive datasets (millions of rows).
  • Downside: A bit harder to set up and manage than Chroma.

Qdrant / Weaviate

  • Format: Running in a Docker container.
  • Advantage: These are professional, production-grade databases that you can scale to gigabytes of data.

3. The Database Content

A row in a Vector Store usually contains three things:

  1. The ID: (e.g., doc_1_page_1).
  2. The Vector: The list of numbers from Ollama.
  3. The Metadata: The actual human text and the source filename (e.g., manual.pdf).

4. Querying the Store

When you ask a question:

  1. Ollama turns your question into a Query Vector.
  2. The Vector Store runs a "Similarity Search."
  3. It returns the top 3 most relevant "Human Text" chunks.
  4. You give those 3 chunks to your LLM (Llama 3) to summarize.

Summary Table: Which Database?

TaskRecommendation
Learning RAGChromaDB
Small Local AppSQLite (with vector extension)
Enterprise DataQdrant (Docker)
Billion-row scaleFAISS

Key Takeaways

  • Vector Stores are optimized for "Nearest Neighbor" math searching.
  • ChromaDB is the easiest local starting point for Python developers.
  • A "Row" in these databases links Math (Vectors) back to Text (Human words).
  • The database is the "Library" and Ollama is the "Researcher" who reads the books.

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn