Vector databases specialize in rapidly looking up text documents that are most relevant to a piece of query text. This is done by calculating the distance between the query text and the documents. A low distance indicates high relevance. Various distance algorithms exist, such as squared L2, inner product and cosine distance. This lookup opeartion forms the Retrieval part of RAG (Retrieval, Augmentation and Generation). In this article we’ll build a solid foundation on how these databases work. We’ll use Chroma DB as an example.
Continue reading →