How vector databases work and when they're used
Vectors
Vector databases store data in a numerical format as vectors. If you look at an arbitrary group of words, such as "A blue striped cotton shirt," the vector mapping would look something like:
[0.1, -0.2, 0.91, 0.7, -0.21, 0.1 -0.7, 0.4]
This numerical expression contains the coordinates of the words in a multidimensional space. When a sentence, an image, or a video is converted into a vector, the numerical values stand for the meaning of the statement in question. In the example, the vectors of the word groups "A blue striped cotton shirt" and "A nautical cotton shirt" would point to locations close to each other in multidimensional space. The interesting thing here is that the vector database's search algorithm processes the query and computes the distance between the two vectors that are connected in this way by measuring the similarity between vectors, which in turn generates meaning in many modern AI systems.
As a critical software infrastructure, a vector database is designed to store high-dimensional vectors in an efficient way. A traditional online transaction processing (OLTP) or online analytical processing (OLAP) database (Figure 1) organizes data in rows and columns. Queries relate to the values stored in these rows and columns. Some AI applications are based on such databases and attempt to store and retrieve data quickly. However, in some applications, such as those for image recognition or natural language processing and recommendation systems, the data is represented by vectors in a multidimensional space. A vector database stores collections of these vectors that are noted as spatial coordinates with an ID and an optional payload, which usually contains metadata that can be used to further filter the vector search for a more precise query.
...Buy this article as PDF
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.