Utilize Shuttle Qdrant - Vector Search in Rust
Integrate vector search capabilities into your Rust projects with Shuttle Qdrant. Our documentation outlines the process, simplifying your journey.
This plugin allows services to connect to a Qdrant database. Qdrant is a vector database & vector similarity search engine.
You can get started in seconds by cloning our Axum + Qdrant example with
Usage
Add shuttle-qdrant
and qdrant-client
to the dependencies for your service by running cargo add shuttle-qdrant qdrant-client@1.7.0
. This resource will be provided by adding the shuttle_qdrant::Qdrant
attribute to your Shuttle main function.
It returns a qdrant_client::QdrantClient
. When running locally it will by default spin up a Qdrant Docker container for your project.
If you want to connect to a remote database when running locally, you can specify the local_url
parameter.
Parameters
Parameter | Type | Required? | Description |
---|---|---|---|
cloud_url | &str | In deployment | URL of the database to connect to. NOTE: It should use the gRPC port. |
api_key | &str | No | Required if the database requires an API key. |
local_url | &str | No | If specified, connect to this URL on local runs instead of using a Docker container. |
cloud_url
parameter is specifying the gRPC port of the database. This is typically done by adding :6334
at the end.You can use secrets interpolation to set the URL and API key. See below for an example.
Example
In the case of an Axum server, your main function can look like this:
Was this page helpful?