From the course: LLM Foundations: Vector Databases for Caching and Retrieval Augmented Generation (RAG)

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Vector similarity search

Vector similarity search

Vector similarity search is one of the important use cases when using vectors to represent text. It is a key feature in vector databases. Let's quickly review how vector similarity search works. Each vector is a series of data points represented in n dimensions. A given sentence or paragraph can be represented as a vector of data points called sentence embeddings. Similarity measures are used to find how close two given vectors are. This is used to find if two sentences are similar in their semantics. In order to measure similarity, we use distance measures. There are several distance measures available. The popular ones being Euclidean distance or L2, inner product or IP, and cosine similarity. I highly recommend for the learners to become familiar with these techniques as they play a key role in vector performance. So how do we find if two sentences are similar using vector similarity search? How can we find the closest string to an input query string from a list of strings? To…

Contents