ruvector_core/
lib.rs

1//! # Ruvector Core
2//!
3//! High-performance Rust-native vector database with HNSW indexing and SIMD-optimized operations.
4//!
5//! ## Features
6//!
7//! - **HNSW Indexing**: O(log n) search with 95%+ recall
8//! - **SIMD Optimizations**: 4-16x faster distance calculations
9//! - **Quantization**: 4-32x memory compression
10//! - **Zero-copy Memory**: Memory-mapped vectors for instant loading
11//! - **AgenticDB Compatible**: Drop-in replacement with 10-100x speedup
12
13#![warn(missing_docs)]
14#![warn(clippy::all)]
15
16pub mod advanced_features;
17
18// AgenticDB requires storage feature
19#[cfg(feature = "storage")]
20pub mod agenticdb;
21
22pub mod distance;
23pub mod error;
24pub mod index;
25pub mod quantization;
26
27// Storage backends - conditional compilation based on features
28#[cfg(feature = "storage")]
29pub mod storage;
30
31#[cfg(not(feature = "storage"))]
32pub mod storage_memory;
33
34#[cfg(not(feature = "storage"))]
35pub use storage_memory as storage;
36
37pub mod types;
38pub mod vector_db;
39
40// Performance optimization modules
41pub mod arena;
42pub mod cache_optimized;
43pub mod lockfree;
44pub mod simd_intrinsics;
45
46/// Advanced techniques: hypergraphs, learned indexes, neural hashing, TDA (Phase 6)
47pub mod advanced;
48
49// Re-exports
50pub use advanced_features::{
51    ConformalConfig, ConformalPredictor, EnhancedPQ, FilterExpression, FilterStrategy,
52    FilteredSearch, HybridConfig, HybridSearch, MMRConfig, MMRSearch, PQConfig, PredictionSet,
53    BM25,
54};
55
56#[cfg(feature = "storage")]
57pub use agenticdb::AgenticDB;
58
59pub use error::{Result, RuvectorError};
60pub use types::{DistanceMetric, SearchQuery, SearchResult, VectorEntry, VectorId};
61pub use vector_db::VectorDB;
62
63#[cfg(test)]
64mod tests {
65    use super::*;
66
67    #[test]
68    fn test_version() {
69        // Verify version matches workspace - use dynamic check instead of hardcoded value
70        let version = env!("CARGO_PKG_VERSION");
71        assert!(!version.is_empty(), "Version should not be empty");
72        assert!(version.starts_with("0.1."), "Version should be 0.1.x");
73    }
74}