Vector Databases
Vector databases store numerical representations called embeddings and retrieve items whose vectors are near a query vector. They support similarity search for tasks such as semantic retrieval, recommendations, and retrieval-augmented generation.
itDatabases and data storage | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Intro
Vector Databases
A vector database stores vectors with identifiers, metadata, and source objects. It retrieves items whose vectors are close to a query vector under a chosen distance rule.
Use one mental model:
source object → embedding model → vector + metadata → index
query object → same model → query vector → candidates → rerank → result
The database does not understand meaning by itself. An embedding model maps inputs into a vector space. The database stores those vectors and searches that space efficiently.
What a vector represents
A vector is an ordered list of numbers. Its dimension is the number of values in that list. An embedding is a vector produced by a model to represent an input such as text, an image, audio, or a product.
Nearby embeddings may represent similar inputs according to the model and its training objective. That similarity is task-dependent. A model useful for English semantic search may be poor for source code, images, or another language.
Store the embedding model identity and version with the collection. Vectors produced by different models or incompatible versions do not automatically share a meaningful space.
Similarity needs a metric
A distance metric defines what “near” means.
- Cosine distance compares vector direction.
- Euclidean distance measures straight-line distance.
- Inner product uses the dot product and is often used when the embedding model expects it.
The embedding model's documentation should guide the metric. Changing the metric can change result order. Normalization can make some metrics closely related, but you should not assume vectors are normalized.
Exact and approximate search
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://milvus.io/docs/overview.md
Supports
- Vector database architecture and vector similarity search
- Vector records, indexing, scale, and distributed database concerns
- Flat, HNSW, IVF, DiskANN, and quantization-based index availability
- https://github.com/pgvector/pgvector
Supports
- Exact nearest-neighbor search and approximate HNSW and IVFFlat indexes
- Cosine, Euclidean, inner-product, and other distance operators
- Index tuning, filtering, iterative scans, updates, and operational behavior
- https://docs.weaviate.io/weaviate/concepts/vector-index
Supports
- Vector indexes as structures for efficient similarity search
- Flat, HNSW, dynamic, graph, and compressed index concepts
- Recall, latency, memory, construction, and update tradeoffs
- https://docs.weaviate.io/weaviate/concepts/filtering
Supports
- Interaction between structured filtering and vector search
- Integrated filtering behavior and filtered-search considerations
- https://weaviate.io/developers/weaviate/starter-guides/managing-resources/indexing
Supports
- Asynchronous vector indexing and index resource choices
- Vector and inverted indexes for similarity and filtering
- https://arxiv.org/abs/1603.09320
Supports
- Hierarchical navigable small-world graphs for approximate nearest-neighbor search
- Multilayer graph construction and search
