Rust client library for the Chroma AI-native database.
This crate provides a comprehensive, production-ready client for interacting with Chroma, an AI-native open-source embedding database. Chroma transforms embeddings into queryable databases, enabling similarity search, filtering, and retrieval operations over high-dimensional vector data.
Features
- Automatic retries - Configurable exponential backoff with jitter for resilient network operations
- OpenTelemetry support - Optional metrics collection for observability (enable
opentelemetryfeature) - TLS flexibility - Support for both native-tls and rustls backends
Core Types
- [
ChromaHttpClient] - Main client for database-level operations (create/list/delete collections) - [
collection::ChromaCollection] - Collection handle for CRUD operations on records (add/get/query/update/delete) - [
ChromaHttpClientOptions] - Configuration for client initialization including auth and retry behavior
Quick Start
Connecting to Chroma Cloud
use ;
# async
Managing Databases
# use ChromaHttpClient;
# async
Working with Collections
# use ChromaHttpClient;
# async
Authentication
The client supports multiple authentication methods:
- Cloud API Key - For Chroma Cloud deployments using
ChromaAuthMethod::cloud_api_key - Custom Headers - For self-hosted instances with custom auth via
ChromaAuthMethod::HeaderAuth - No Auth - For local development with
ChromaAuthMethod::None
Error Handling
All operations return Result<T, ChromaHttpClientError> where ChromaHttpClientError
captures network errors, serialization failures, and validation errors.
# use ChromaHttpClient;
# use ChromaHttpClientError;
# async
Feature Flags
default- Enablesnative-tlsfor TLS supportnative-tls- Use native system TLS (OpenSSL on Linux, Secure Transport on macOS)rustls- Use pure-Rust TLS implementationopentelemetry- Enable metrics collection for request latency and retry counts