post_cortex_embeddings/vector_db/mod.rs
1// Copyright (c) 2025, 2026 Julius ML
2// Licensed under the MIT License. See LICENSE at the workspace root.
3
4//! HNSW vector database — types + impl.
5//!
6//! [`types`] is dependency-light (only `serde`, `chrono`, `uuid`,
7//! `std::sync::atomic`). The HNSW index + product-quantization codebook
8//! live in private modules and are reachable through the [`VectorDB`]
9//! entry point. Storage backends that only need to round-trip
10//! [`VectorMetadata`] and [`SearchMatch`] can depend on
11//! `post-cortex-embeddings` with `default-features = false`, which
12//! compiles only this `types` module.
13
14pub mod types;
15
16// HNSW impl modules. Behind the `bert` feature today via the rest of the
17// pipeline; we keep them unconditional so non-BERT consumers can still
18// build the HNSW path with a custom embedding backend.
19mod common;
20pub mod config;
21pub mod core;
22mod hnsw_index;
23pub mod product_quantization;
24
25#[cfg(test)]
26mod tests;
27
28pub use config::{SearchMode, SearchQualityPreset, VectorDbConfig};
29pub use core::VectorDB;
30pub use product_quantization::ProductQuantizationCodebook;
31pub use types::{SearchMatch, StoredVector, VectorDbStats, VectorDbStatsSnapshot, VectorMetadata};