23-6 Qdrant - Getting started with a Vector DB powered Meme Recommender
We explored Pinecone and Chroma, where the latter was easy to install and run locally. The former could scale up per need and use case. We also saw how Langchain and Llama Index make it possible to abstract away the embedding and loading process. Starting your own Vector Database with your own set of documents is accessible more than ever.
Another Vector DB to note is Qdrant. In their home page, Qdrant “is a vector similarity search engine that provides a production-ready service with a convenient API to store, search, and manage points (i.e. vectors) with an additional payload. (Source: What is Qdrant? - Qdrant.)
The above link also provides some details on what a Vector Database is, how it is different from other forms of DBs and some use cases. The page is worth reviewing simply to recap on the basics. Navigating to the main page we can even review live demos of Qdrant in action.
Qdrant offers flexibility of deployment methods like Chroma
An interesting read on what makes Qdrant spark for Production use cases is the internal benchmarks the team has done to compare latency and Requests-per-Second (RPS). Vector Database Benchmarks - Qdrant
The Vector Search Solutions page offers a glimpse into how a Vector DB like Qdrant can be incorporated for business challenges and needs, ranging from Recommendation, Semantic Text and Image Search as well as Anomaly detection. If you were thinking Vector DBs only in RAG framework, this page opens up the mind for possibilities.
Since we have gone through a local vector store last time with Chroma, let's try Qdrant Cloud. https://cloud.qdrant.io/ (note you can easily install a local storage option too)
Upon signing in we can create our first cluster in the free tier.
Select the Get API Key and copy the details somewhere safe.
We are now ready to build with Qdrant.
Open up a clean notebook and install the Qdrant Python Client
领英推荐
pip install qdrant-client
Optionally if you are running in a CPU instance, locally or in the cloud
pip install qdrant-client[fastembed]
from qdrant_client import QdrantClient
qdrant_client = QdrantClient(url="YOUR_URL". api_key="YOUR_API")
If you missed the URL key during the setup process,
Go to the console, select the Clusters Tab and copy the URL under Cluster URL
Let's try something more than similar text retrieval and generation. At this rate, it is becoming too repetitive and we still have more vector DBs to cover.
We will create a Meme Image Recommender.
Note this app can be overkill and you can easily create a Meme using custom GPTs or open source tools. Here we are primarily focused on learning similarity search for images and text while taking advantage of Qdrant's unique recommendation API. (if I am capable to use it)
Let's start with reviewing and processing the dataset to start our journey. See you there.
Data geek and developer advocate supreme
1 年I did a project recently with Llamaindex and Lancedb for the vector store. Crazy simple and fast.