Module ops

Module ops 

Source
Expand description

Vector search operators.

This module provides operators for vector similarity search that can be composed into query pipelines. Operators implement an iterator-like interface for streaming results.

§Operators

  • AnnScan - Approximate nearest neighbor search using HNSW index
  • ExactKnn - Brute force k-NN search for small sets or validation
  • VectorFilter - Post-filter vector results by predicates

§Multi-Vector / ColBERT

The [maxsim] module provides MaxSim scoring for ColBERT-style late interaction models, where each query/document is represented as multiple token embeddings.

The hybrid module provides support for combining dense and sparse vector similarity scores using weighted combinations or reciprocal rank fusion.

§Iterator Design

All operators implement the VectorOperator trait, which provides a streaming interface for results:

use manifoldb_vector::ops::{VectorOperator, AnnScan};

let mut scan = AnnScan::new(index, query, k)?;
while let Some(result) = scan.next()? {
    println!("Entity: {:?}, Distance: {}", result.entity_id, result.distance);
}

§Search Modes

The operators support two primary search modes:

  • Find K nearest: Return the K closest vectors to the query
  • Find within distance: Return all vectors within distance D of the query

§Combining with Graph Traversal

Vector operators can be combined with graph traversal to find similar neighbors or filter graph results by vector similarity.

Re-exports§

pub use hybrid::merge_results;
pub use hybrid::reciprocal_rank_fusion;
pub use hybrid::HybridConfig;
pub use hybrid::HybridMatch;
pub use maxsim::maxsim;
pub use maxsim::maxsim_batch;
pub use maxsim::maxsim_cosine;
pub use maxsim::MaxSimScorer;

Modules§

hybrid
Hybrid dense+sparse vector search.
maxsim
MaxSim scoring for ColBERT-style late interaction models.

Structs§

AnnScan
Approximate nearest neighbor search operator.
ExactKnn
Exact k-NN search operator using brute force.
FilterBuilder
Builder for composing multiple filters.
SearchConfig
Configuration for search operations.
VectorFilter
Filter operator for post-filtering vector search results.
VectorMatch
A match from a vector search operation.

Traits§

VectorOperator
Trait for vector search operators.