Video Transcript (English)
Congratulations on completing this unit.
In this unit, you learned how Atlas Vector Search works.
Now you're ready to seamlessly implement Atlas Vector Search in your own application to allow your users to perform semantic searches on your data.
Let’s recap what we covered.
First, we learned that vectors are encoded representations of unstructured data like text, images, and audio. They're encoded as a list of numbers within an array, and each array value represents a dimension.
After that, we learned about sparse and dense vectors.
Sparse vectors hold a small amount of data. Most of the dimensions of a sparse vector are zero which, when compared to other sparse vectors, usually represents the absence or presence of a similarity.
On the other hand, dense vectors hold significantly more information.
They're used to capture complex relationships which is why they are used for Atlas Vector Search.
Then we generated vector embeddings for our data using an embedding model.
After that, we learned that Atlas Vector Search uses a Hierarchical Navigable Small World graph or HNSW to index vector embeddings.
HNSW graphs plot multiple points with connecting long and short links and are made up of multiple layers. As the layers move up fewer points are plotted and the links become longer.
We also learned that Atlas uses the approximate nearest neighbor algorithm to search HNSW graphs.
Next, we created a vector search index for the embeddings we generated.
We learned that we can use either Euclidean, cosine or dotProduct as the similarity function for our vector search index.
After that, we learned how to leverage the $vectorSearch stage of the aggregation framework to create a vector search query.
Then, we learned how to implement hybrid search, which leverages the results from both Atlas Search and Atlas Vector Search to find the best result determined by an algorithm called reciprocal rank fusion.
Reciprocal Rank Fusion is an algorithm we can use to assign scores to each of the results for both types of searches. We then combine those scores to determine which result is the best match.
Finally, we used the $vectorSearch, $search, and $unionWith aggregation stages to implement hybrid search.
Now that you know the basics of Atlas Vector Search, you might want to check out the units on Atlas Search.
You can also visit MongoDB’s documentation.
We hope you enjoyed learning about it as much as we enjoyed teaching it.
Until next time, keep learning!