hyperspace-sdk (Rust)
Official Rust client for HyperspaceDB gRPC data plane.
This crate provides:
- authenticated gRPC client
- collection management
- insert/search APIs
- high-throughput
search_batch f32helper methods for Euclidean workloads (insert_f32,search_f32,search_batch_f32)
Installation
[]
= "2.2.1"
= { = "1", = ["macros", "rt-multi-thread"] }
Quick Start
use Client;
use HashMap;
async
Batch Search
Use search_batch to reduce RPC overhead:
let responses = client.search_batch.await?;
Each entry in responses corresponds to one query vector.
f32 Helpers
When your app keeps Euclidean vectors in f32, use conversion helpers:
insert_f32search_f32search_batch_f32
The crate converts to protocol f64 once per call.
API Surface (Core)
Client::connectcreate_collection,delete_collection,list_collectionsinsert,insert_f32search,search_f32,search_advancedsearch_batch,search_batch_f32deleteconfigureget_collection_stats,get_digesttrigger_vacuum,rebuild_index,rebuild_index_with_filterget_neighbors_with_weights(graph edges with distances)subscribe_to_events(CDC stream)
Rebuild with Pruning
client
.rebuild_index_with_filter
.await?;
Hyperbolic Math Utilities
use ;
Optional Feature: Embedders
Enable with:
= { = "2.2.1", = ["embedders"] }
Production Notes
- Reuse long-lived clients instead of reconnecting per request.
- Prefer
search_batchon concurrency-heavy paths. - Keep collection metric/dimension consistent with your vector source.