Skip to main content

nodedb_vector/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2
3//! Vector search primitives shared by Origin, Lite, and WASM: HNSW + Vamana
4//! indexes, scalar / SIMD distance kernels, the quantization codec frontier
5//! (SQ8, PQ, IVF-PQ, OPQ, RaBitQ, BBQ, Ternary BitNet 1.58, Binary), the
6//! VectorCollection runtime with mmap NVMe segments and background builder,
7//! and the cost-model planner inputs (target_recall, oversample, ef_search,
8//! query_dim, meta_token_budget, quantization).
9//!
10//! This crate has no platform-required cargo features for v0.1.0 — SIMD
11//! kernels are gated by `#[cfg(target_arch)]` and dispatch happens at
12//! runtime. The optional `acorn-baseline` feature retains the old ACORN-1
13//! filtered-traversal heuristic for benchmarking against NaviX; not for
14//! production use.
15
16pub mod batch_distance;
17pub mod codec_index;
18pub mod delta;
19pub mod distance;
20pub mod error;
21pub mod hnsw;
22pub mod hybrid;
23pub mod matryoshka;
24pub mod multivec;
25pub mod quantize;
26pub mod vamana;
27
28pub use distance::DistanceMetric;
29pub use error::VectorError;
30pub use hnsw::{HnswIndex, HnswParams, SearchResult};
31pub use nodedb_types::Surrogate;
32pub use quantize::Sq8Codec;
33
34// NaviX adaptive-local filtered traversal (VLDB 2025).
35pub mod navix;
36
37// SIEVE workload-driven subindex collection for stable predicates (SIEVE 2025).
38pub mod sieve;
39
40// Cost-based multidimensional vector query planner.
41pub mod planner;
42
43// Origin-only modules (always compiled for native targets).
44pub mod adaptive_filter;
45pub mod flat;
46pub mod index_config;
47
48// IVF-PQ index (large datasets).
49pub mod ivf;
50
51// NVMe mmap tier (requires libc).
52pub mod mmap_segment;
53
54// Background HNSW builder thread.
55pub mod builder;
56
57// Full VectorCollection with segment lifecycle.
58pub mod collection;
59
60// Re-exports for unconditionally compiled types.
61pub use adaptive_filter::{
62    FilterStrategy, FilterThresholds, adaptive_search, estimate_selectivity, select_strategy,
63};
64pub use builder::{BuildSender, CompleteReceiver};
65pub use collection::{BuildComplete, BuildRequest, StorageTier, VectorCollection};
66pub use flat::FlatIndex;
67pub use index_config::{IndexConfig, IndexType};
68pub use ivf::{IvfPqIndex, IvfPqParams};