Chroma Rust Library
This is a Rust library for interacting with the ChromaDB vector database. It's intended for learning and educational purposes. For a more advanced library, please check out chromadb.
The asynchronous example uses Tokio crate.
1. Running the Backend
Here's how to run the ChromaDB backend using Docker:
default configuration:
with auth using token & persistant storage:
2. Default Client
Here's a basic example of how to create a default client:
use ;
let client = new;
3. Advanced Client
For more advanced usage, you can create a client with custom parameters:
let mut hmap = new;
hmap.insert;
let settings = Settings
let client = new;
4. Chroma client methods
- Heartbeat:
let hb = client.heartbeat.await?;
- Get all collections:
let collections = client.list_collections.await?;
- Create a collection without metadata:
let new_collection = client.create_collection.await?;
- Create a collection with metadata:
let mut metadata = new;
metadata.insert;
metadata.insert;
let new_collection = client
.create_collection.await?;
- Create a collection using get or create:
let new_collection = client.get_or_create_collection.await?;
- Get a collection:
let collection = client.get_collection.await?;
- Delete a collection:
let deleted_collection = client.delete_collection.await?;
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.