Reference articles on history, science, culture and more
Encyclopedia

Vector database

Type of database that uses vectors to represent other data

A vector database, vector store or vector search engine is a database that stores and retrieves embeddings of data in vector space. Vector databases typically implement approximate nearest neighbor algorithms so users can search for records semantically similar to a given input, unlike traditional databases which primarily look up records by exact match. Use-cases for vector databases include similarity search, semantic search, multi-modal search, recommendations engines, object detection, and retrieval-augmented generation (RAG).

Vector embeddings are mathematical representations of data in a high-dimensional space. In this space, each dimension corresponds to a feature of the data, with the number of dimensions ranging from a few hundred to tens of thousands, depending on the complexity of the data being represented. Each data item is represented by one vector in this space. Words, phrases, or entire documents, as well as images, audio, and other types of data, can all be vectorized.

These feature vectors may be computed from the raw data using machine learning methods such as feature extraction algorithms, word embeddings or deep learning networks. The goal is that semantically similar data items receive feature vectors close to each other.

Vector retrieval can be combined with metadata filtering, lexical or sparse retrieval, graph-based retrieval, and multimodal retrieval to support a range of filtered and hybrid retrieval workflows.

01Techniques

Common techniques for similarity search on high-dimensional vectors include:

These techniques may also be combined in vector search systems.

In recent benchmarks, HNSW-based implementations have been among the best performers. Conferences such as the International Conference on Similarity Search and Applications (SISAP) and the Conference on Neural Information Processing Systems (NeurIPS) have hosted competitions on vector search in large databases.

02Applications

Vector databases are used in a wide range of machine learning applications including similarity search, semantic search, multi-modal search, recommendations engines, object detection, and retrieval-augmented generation.

Retrieval-augmented generation

An especially common use-case for vector databases is in retrieval-augmented generation (RAG), a method to improve domain-specific responses of large language models. The retrieval component of a RAG can be any search system, but is most often implemented as a vector database. Text documents describing the domain of interest are collected, and for each document or document section, a feature vector (known as an "embedding") is computed, typically using a deep learning network, and stored in a vector database along with a link to the document. Given a user prompt, the feature vector of the prompt is computed, and the database is queried to retrieve the most relevant documents. These are then automatically added into the context window of the large language model, and the large language model proceeds to create a response to the prompt given this context.

03Implementations

NameLicense
Aerospike Proprietary
AllegroGraph Proprietary (Managed Service)
AlloyDB AIProprietary (Managed Service)
Apache Cassandra Apache License 2.0
Azure Cosmos DB Proprietary (Managed Service)
Chroma Apache License 2.0
ClickHouse Apache License 2.0
Couchbase BSL 1.1
CrateDB Apache License 2.0
DataStax Proprietary (Managed Service)
Db2 Proprietary (Managed Service or License)
Elasticsearch Server Side Public License, Elastic License
JaguarDB Proprietary
LanceDB Apache License 2.0
LlamaIndex MIT License
MariaDB GPL v2
Marqo Apache License 2.0
Meilisearch MIT License
Milvus Apache License 2.0
MongoDB Atlas Server Side Public License (Managed service)
MyScaleDB Apache License 2.0
Neo4j GPL v3 (Community Edition)
ObjectBox Apache License 2.0
OpenSearch Apache License 2.0
Oracle Database Proprietary (Managed Service or License)
Pinecone Proprietary (Managed Service)
Pixeltable (Incremental Embedding) Apache License 2.0
Postgres with pgvector PostgreSQL License
Qdrant Apache License 2.0
Redis Stack Redis Source Available License Archived 2024-01-31 at the Wayback Machine
ScyllaDB Proprietary Source Available
Snowflake Proprietary (Managed Service)
SurrealDB BSL 1.1
TiDB Apache License 2.0
Typesense GPL v3 (Community Edition)
Vespa Apache License 2.0
Weaviate BSD 3-Clause
YDB Apache License 2.0
Watch videos about Vector databaseExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Vector database, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.