How Vector Search works?

Here is a post with an example of how Vector search works.

What is vector search?

Vector search is a cutting-edge approach to searching and retrieving data that leverages the power of vector similarity calculations. Unlike traditional keyword-based search, which matches documents based on the occurrence of specific terms, vector search focuses on the semantic meaning and similarity of data points. By representing data as vectors in a high-dimensional space, vector search enables more accurate and intuitive search results. 


The following link is where we are going to run our code:

Vector search Colab

To create our Vector search DB click here Astra DataStax


What is happening in the next steps?

Inference – getting the embeddings for our data

Getting the Output that is coming from the MODEL (With the images classification results & a Vector format)  

Saving our embeddings to AstraDB

We are creating our table with the ann_index and inserting the model output into that table

DB is: cristinaVector

Create a table called: images into our keyspace called: cristinavectorks

Who is doing the magic inside our Vector DB to give us an image similarity? 

ann_index who is using the ANN (Approximate Nearest Neighbors) that  is an algorithm that efficiently finds approximate nearest neighbors to a given query point in a large dataset.

Querying our data with another image

1.- Let’s pretend to upload an image to your cool new image-to-image search app.
2.- It is going to calculate its embeddings and then ask the database for similar images (Returning ‘nearest neighbor’ using ANN search)

By Cristina Rojas