Vector Database definition
A vector database is a database designed to store embeddings, which are numeric vectors representing the meaning of text, images or other data, and to quickly find the vectors most similar to a query. It powers semantic search, recommendations and retrieval-augmented generation by matching items on meaning rather than on exact keywords.
How does a vector database work?
Each item, such as a paragraph from a manual or a product photo, is passed through an embedding model that outputs a vector of hundreds or thousands of numbers. The database stores that vector with an ID and metadata such as source, date and access rights. At query time, the question is embedded with the same model, and the database returns the stored vectors closest to it by cosine similarity, dot product or Euclidean distance.
Comparing a query with every stored vector is too slow at scale, so vector databases use approximate nearest neighbor (ANN) indexes. HNSW builds a layered graph that can be searched in a few hops. IVF partitions vectors into clusters and searches only the nearest ones, and product quantization compresses vectors to save memory. Each index trades a little recall for large gains in speed.
Popular vector databases
The line between these categories keeps blurring, as general databases add vector indexes and dedicated engines add keyword search, filtering and transactions. For most teams the deciding factor is operational: whether running another stateful system is worth it, or whether the database they already back up, monitor and secure can handle vectors too.
- Dedicated vector databases: Pinecone, Weaviate, Qdrant, Milvus and Chroma.
- Extensions to existing databases: pgvector for PostgreSQL, MongoDB Atlas Vector Search, Redis.
- Search engines with vector support: Elasticsearch and OpenSearch.
- Libraries for building custom indexes: FAISS and hnswlib.
Vector database vs traditional database
A relational database answers exact questions: rows where status equals "open" and amount exceeds 500. A vector database answers fuzzy ones: the ten passages most similar in meaning to "how do I cancel my plan", even when they say "terminate subscription" instead. Most applications need both, which is why filtering by metadata during vector search, and hybrid search that combines vectors with keyword matching, are essential features.
Use cases and an example
Worked example: an ecommerce site embeds every product title, description and image. When a shopper searches "something warm for hiking in the rain", the vector search returns waterproof insulated jackets even though none contains those exact words, while a metadata filter keeps out-of-stock items away from the results.
- Retrieval for RAG chatbots and internal knowledge assistants.
- Semantic and multilingual search.
- Product and content recommendations.
- Duplicate and near-duplicate detection.
- Image similarity search and anomaly detection.
- Matching job candidates to roles, or support tickets to known issues.
How to choose a vector database
Consider data volume, query rate, metadata filtering, hybrid search support, multi-tenant isolation, update frequency, hosting model and cost. For many applications with up to a few million vectors, pgvector inside an existing PostgreSQL database is enough and avoids running another system. Nexzem usually starts there and moves to a dedicated engine only when load tests show a real need. Benchmark candidates with your own embeddings and filters, since published numbers rarely match real query patterns.