Semantic search changes the way we think about searching data. Instead of relying only on exact keywords, semantic search attempts to understand the meaning and intent behind a query and retrieve information that is conceptually related to what the user is looking for. This presentation, “Semantic Search in Practice – Implemented with MongoDB and Voyage AI,” introduces the fundamental ideas behind semantic search and demonstrates how they can be implemented in a practical software application.
The presentation begins with the basic concepts of semantic understanding, semantic search, vector embeddings, and embedding models. It explains how words, sentences, and other types of data can be represented as numerical vectors in a multidimensional space, where semantically similar information tends to be positioned closer together. It also introduces several common techniques for measuring similarity between vectors, including cosine similarity, Euclidean distance, and dot product similarity.
The practical part of the presentation demonstrates how to generate embeddings using Voyage AI, how to create embeddings for documents and search queries, and how to rank documents according to their semantic similarity. Python code samples show the complete process, including generating document embeddings, generating query embeddings, calculating similarity, and retrieving the most relevant results.
The presentation then moves from a simple in-memory implementation to a more realistic architecture using MongoDB Atlas. It explains how embeddings can be stored together with the original MongoDB documents, how to create a Vector Search Index, how to generate an embedding for a user's query, and how to perform semantic search using MongoDB's $vectorSearch aggregation stage.
The slides also connect semantic search with RAG — Retrieval-Augmented Generation. Once data is represented by embeddings and can be retrieved through vector search, it can be supplied as contextual information to generative AI applications, helping them produce answers based on relevant external information. The presentation concludes with MongoDB's autoEmbed capability, which can automatically generate Voyage AI embeddings from document fields at index time, reducing the need to calculate and store embeddings manually.
This presentation is intended for software developers who want to understand what semantic search is, how vector embeddings make it possible, and how the complete process can be implemented using Python, MongoDB, and Voyage AI.
You can find the post that summarizes this meetup at https://lifemichael.com/en/semantic-search-in-practice-with-mongodb.
You can find more information about that meetup at https://www.meetup.com/lifemichael/events/315942806