Skip to main content

Module async_vector_index

Module async_vector_index 

Source
Expand description

Async vector index trait for remote/shared backends (needs async_trait). Async vector index trait for remote/shared backends.

The existing VectorIndex is a synchronous, in-process trait (&mut self, blocking search). That fits compressed in-memory indexes (TurboQuant) but not remote vector services such as Qdrant or Elasticsearch, whose clients are async-only and naturally shared (&self) rather than exclusively borrowed.

AsyncVectorIndex is the async, object-safe counterpart for those backends. It mirrors the useful subset of VectorIndex โ€” add, remove, search, filtered search, length, dimensionality โ€” and omits save because remote backends persist server-side (just as VectorIndex omits load to stay object-safe). Concrete implementations live in this crate behind feature flags: the qdrant feature (src/embedding/qdrant.rs) and the elastic feature (src/embedding/elastic.rs).

The trait has no concrete dependencies beyond async_trait. It is defined behind the embedding feature so the shared contract stays in the kernel while the heavy client crates remain opt-in.

Traitsยง

AsyncVectorIndex
Async, object-safe vector index for remote/shared backends.