Learning brief
TrendingGenerated by AI from multiple sources. Always verify critical information.
TL;DR
Vector databases store data as mathematical embeddings (arrays of numbers representing meaning) and let you search by similarity rather than exact keywords. They're the backbone of RAG systems, recommendation engines, and semantic search. Think of them as databases that understand meaning, not just matching text.
What Happened
Traditional databases search by exact matching — find rows where the name column equals 'John.' Vector databases flip this by searching for meaning. Text, images, and other data are converted into high-dimensional vectors (embeddings) that capture semantic meaning. Similar concepts end up close together in vector space.
When you search a vector database, your query is also converted to a vector, and the database finds the nearest neighbors — the stored vectors closest to yours in meaning. 'How do I fix a broken pipe?' would match documents about plumbing repairs even if they never use those exact words.
Popular options include Pinecone (fully managed), Weaviate (open source), Chroma (lightweight/local), and pgvector (PostgreSQL extension). Each has trade-offs between ease of use, scale, and cost.
So What?
If you're building any AI application that needs to work with your own data — RAG, semantic search, recommendations, deduplication — you'll likely need a vector database. They've become a fundamental building block of the AI application stack.
The good news is you don't always need a dedicated vector database. For small datasets (under 100K documents), in-memory solutions or pgvector work fine. Only reach for dedicated vector DBs when you need scale, filtering, or real-time updates.
Now What?
Start with pgvector if you already use PostgreSQL — avoid adding new infrastructure
For prototypes, use Chroma (runs locally, zero config)
Choose your embedding model carefully — OpenAI's text-embedding-3-small is a good default
Test retrieval quality with real queries before optimizing for speed