Rig Milvus integration
This crate integrates Milvus into Rig, allowing you to easily use RAG with this database.
Installation
To install this crate, run the following command in a Rust project directory which will add rig-milvus as a dependency (requires rig-core added for intended usage):
There's a couple of different ways you can run Milvus:
- Through a Docker container, either locally or on Docker-compatible architecture
- Their Docker container requires using an install script to use which is listed on the page and can be found directly on the Milvus repo.
- They also support Kubernetes, although you will probably need to already know how to use Kubernetes to do this.
- Using the Zilliz cloud offering
- Using the cloud offering you can manage your Milvus instance through their web UI.
Before creating a collection that is compliant with rig-milvus, ensure you set up your Milvus related environment variables:
To create a collection, you will need the bash script below.
This will create a collection with the following fields:
- an ID field (auto-generated as i64 but converted to String when using
top_n()) - an
embeddingfield for storing vectors - a
documentfield (for storing metadata) - an
embeddedTextfield (for the actual item that was embedded)
Once done, you'll now be ready to use!
How to run the example
To run the example, add your OpenAI API key as an environment variable. Don't forget your Milvus username, password, database & collection name and endpoint URL if you're executing this from a new terminal tab/window:
Finally, use the following command below to run the example: