Setting up a semantic search functionality is easy using Langchain, a relatively new framework for building applications powered by Large Language Models.
Semantic search means performing a search where the results are found based on the meaning of the search query. This is in contrast to a simple keyword search, which will only find results that match exactly to the search term entered. A good example of what semantic search enables is that if we search for “car”, we can not only retrieve results for “car” but also “vehicle” and “automobile”.
The underlying process to achieve this is the encoding of the pieces of text to embeddings, a vector representation of the text, which can then be stored in a vector database. When a search is performed, the search term is also encoded into it’s embeddings and the closest vector representations is searched for in our database.