| Part of a series on |
| Machine learning and data mining |
|---|
A vector database, vector store or vector search engine is a database that stores and retrieves embeddings of data in vector space. [1] 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. [2] [3] Use-cases for vector databases include similarity search, semantic search, multi-modal search, recommendations engines, object detection, and retrieval-augmented generation (RAG). [1]
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. [1]
These feature vectors may be computed from the raw data using machine learning methods such as feature extraction algorithms, word embeddings [4] or deep learning networks. The goal is that semantically similar data items receive feature vectors close to each other.
The most important techniques for similarity search on high-dimensional vectors include:
and combinations of these techniques.[ citation needed ]
In recent benchmarks, HNSW-based implementations have been among the best performers. [5] [6] Conferences such as the International Conference on Similarity Search and Applications (SISAP) [7] and the Conference on Neural Information Processing Systems (NeurIPS) [8] have hosted competitions on vector search in large databases.
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. [1]
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. [9]
A vector database is a type of database that stores data as high-dimensional vectors, which are mathematical representations of features or attributes.