Skip to content

Vector Database

Medium — good to knowAI & ML

ELI5 — The Vibe Check

A vector database is a special database built to store and search embeddings. Normal databases are bad at 'find me the 10 most similar items' — they'd have to check everything. Vector databases use clever indexing (like HNSW or IVF) to find similar vectors super fast. They're the backbone of AI-powered search and RAG systems.

Real Talk

Vector databases store high-dimensional embedding vectors and provide efficient approximate nearest neighbor (ANN) search. They support similarity queries at scale using indexing algorithms like HNSW, IVF-PQ, and FAISS. Popular options include Pinecone, Weaviate, Qdrant, Chroma, and pgvector (Postgres extension).

Show Me The Code

import chromadb
client = chromadb.Client()
collection = client.create_collection("docs")
collection.add(
    documents=["The cat sat on the mat"],
    embeddings=[[0.1, 0.2, 0.3]],
    ids=["doc1"]
)
results = collection.query(query_embeddings=[[0.1, 0.2, 0.35]], n_results=3)

When You'll Hear This

"Store all our support docs in a vector database for RAG." / "Query the vector database for the most relevant chunks."

Made with passive-aggressive love by manoga.digital. Powered by Claude.