From the course: Hands-On AI: RAG using LlamaIndex
Choosing a vector database
- [Instructor] Without a doubt, vector databases are an essential part of any Retrieval-Augmented Generation system. And as this image shows here, there's a lot to choose from. So how should you think about choosing a vector database for your RAG applications? There's several factors that you should consider. For one is the performance on similarity search. So RAG relies heavily on efficient similarity search to retrieve relevant documents or passages. The vector database that you choose should provide fast and accurate similarity search capabilities. Scalability is also a concern. So as the amount of data grows, the vector database should be able to scale horizontally and handle large scale indexing and querying. You should look at the integration with various LLM frameworks. If a vector database integrates well with the popular LLM orchestration frameworks, then it's going to allow for a seamless interaction between the RAG system and the vector database. You want a vector database that supports various data types. You might be dealing with not only text, but you might be dealing with images, video, or audio. So whatever vector database you choose should support storing and indexing vectors that are derived from practically any data type. You also want a vector database that has efficient indexing mechanisms that's going to quickly build and update the index as new data is added or modified. Retrieval flexibility is absolutely key. The vector database you choose should offer flexibility in retrieval options, for example, specifying the number of nearest neighbors to retrieve, setting similarity thresholds, or applying filters based on metadata, because without this flexibility, it's going to be hard to customize and fine-tune your retrieval process. Data persistence and reliability, of course, is super critical. The vector database should be reliable and able to handle potential failures or data loss scenarios. And one thing that is always super important to me, is this community support and documentation. So look around at the vector database providers that are out there and consider the level of community support and documentation that are available. An active community, good documentation is going to help you with troubleshooting, optimization, and just staying updated with the latest features and best practices. Also to consider is ease of use and deployment, and perhaps the most important is cost and licensing. So consider a vector database's cost and its licensing model. Look at pricing, scalability cost, or any other limitations or restrictions that are imposed by the licensing terms. So as I mentioned before in this course, we are using Qdrant, for a number of reasons, for example, for all the reasons I mentioned above, but for some other reasons as well. So for one, Qdrant is one of the most popular vector databases on LlamaIndex Hub, So it's like the most popular vector database on LlamaIndex Hub. So that's one big reason for sure. The documentation is amazing. That's very comprehensive documentation, there's a lot of community support. The team behind Qdrant is super technical, they've got a great DevRel team. And you know, me being a DevRel professional, that's, I think, high compliments. Not saying that I'm the greatest DevRel individual out there, but their team is quite well and they have a really huge focus on education. Qdrant is also used by some heavy hitters in the industry. So for example, it's rumored that OpenAI uses Qdrant. It's also rumored that, behind the scenes, like Microsoft Azure, their AI search is backed by Qdrant. Also xAI, you know, Elon Musk's thing, uses Qdrant and you can see that because they have forked Qdrant at their GitHub org. Not only that, just a lot of the people in the industry that I respect the most, mention that Qdrant is a excellent choice. My mentor suggested that I use it as well. And every cohort based learning program that I've gone through, for example, like through the various providers, Qdrant is one that seems to be used quite regularly. Because I've had so much exposure to using Qdrant, it's one of the main reasons why I'm using it in this course. Of course, like you can use whatever it is that you want. LlamaIndex makes it easy to kind of, plug and play different components, so if you don't want to use Qdrant, you could use something else, but I'll be using that throughout this course. In the next video I'm going to show you how to set up a Qdrant account, get your API key, get your cluster URL, and after that we're almost done setting up and we can start to go ahead and actually do some Retrieval-Augmented Generation.