Key Takeaway
- The integration of the local vector database Milvus with MCP is an essential part of building an AI knowledge base. It enables the decoupling of local large models from the knowledge base.
- Deploying Milvus requires Docker (it's recommended to use lightweight alternatives like OrbStack). Additionally, knowledge of vector dimensions and embedding models is necessary.
- The choice of vector dimensions and embedding models must be carefully considered to ensure accurate retrieval results.
- The article details the steps for installing Milvus, as well as how to configure the MCP to connect it with AI clients such as Cursor.
- It emphasizes the convenience of creating Collections and importing documents using the Agent mode in Cursor, as well as the important configuration details that need to be taken into consideration.
Full Content
In the video from last week, I introduced the AI tools that I am currently using. Regarding the knowledge base section, I separated the local vector database and the model, connecting them through MCP. Due to time constraints, I didn't go into too much detail at that time. In this exclusive video for the community, I will explain the key points in more detail.
Before starting the deployment process, there are three preparations that need to be completed:
Firstly, Docker. The local vector database I use is Milvus, which is installed and run using Docker. Since it needs to be running for a long time, the original Docker version is not suitable. Those who have used it know that Docker consumes too many resources.
So, I’ve switched to OrbStack. You can think of it as the Mac version of Docker. The engine is the same, but it’s faster, more lightweight, and simpler to use.
I have been running it on the Mac Mini, and I don’t notice any impact on its performance at all. Therefore, I highly recommend using this tool.
Secondly, there’s the issue of vector dimensions. This needs to be taken into consideration when creating collections and selecting embedding models.
A 10-dimensional vector contains 10 values, while a 1536-dimensional vector contains 1536 values. Therefore, higher dimensions generally allow for greater accuracy. However, as the number of dimensions increases and accuracy improves, so do the requirements for computation and storage resources.
My current choice is 1024 dimensions. I think this is a fairly balanced option.
Thirdly, there’s the issue of embedding models. There are two metrics that need to be taken into consideration here.
First, it’s about the languages supported. Here, I use Chinese as my language of communication, so I need to carefully check the level of support for Chinese in this software.
The second factor is the dimensionality of the vectors. For example, OpenAI’s text-embedding-3-small model has a dimension of 1536, while the large model has a dimension of 3072. BGE’s embedding models also come in different sizes: 384, 768, and 1024 dimensions.
The vector dimensions supported by the embedding model must be consistent with those of the Collection you created. You need to create the Collection first, and then use the embedding model to import documents into it. If the vector dimensions are different, additional operations such as dimensionality reduction may be necessary during the import process. Otherwise, the entire process becomes meaningless.
I currently use the bge-large-zh-v1.5 version. This version supports Chinese characters, and has a dimensionality of 1024. It’s exactly the same as the Collection I want to create.
Once the preparations are complete, we can begin the deployment process.
Continue reading the full article
Sign in as a member or explore membership options.