lumosai_vector_core/
lib.rs

1//! # Lumos Vector Core
2//!
3//! Core abstractions and traits for the Lumos vector storage system.
4//! This crate provides the foundational types and interfaces that all
5//! vector storage implementations must follow.
6//!
7//! ## Design Philosophy
8//!
9//! This crate is inspired by the excellent designs of:
10//! - **Rig**: Strong typing and trait-based abstractions
11//! - **Mastra**: Declarative configuration and modularity
12//! - **Lumos**: Enterprise features and performance
13//!
14//! ## Core Concepts
15//!
16//! - **VectorStorage**: The main trait for vector storage backends
17//! - **EmbeddingModel**: Trait for embedding generation
18//! - **Document**: Unified document representation with embedding support
19//! - **SearchRequest/Response**: Structured query interface
20//!
21//! ## Example
22//!
23//! ```rust
24//! use lumosai_vector_core::prelude::*;
25//! use std::collections::HashMap;
26//!
27//! // Create a document with embedding support
28//! let doc = Document::new("doc1", "This is a test document")
29//!     .with_embedding(vec![0.1, 0.2, 0.3])
30//!     .with_metadata("type", "article");
31//!
32//! // Create an index configuration
33//! let config = IndexConfig::new("test_index", 384)
34//!     .with_metric(SimilarityMetric::Cosine);
35//! ```
36
37pub mod error;
38pub mod types;
39pub mod traits;
40pub mod config;
41pub mod performance;
42
43#[cfg(test)]
44mod tests;
45
46// Re-export core types for convenience
47pub use error::{VectorError, Result};
48pub use types::*;
49pub use traits::*;
50pub use config::*;
51pub use performance::*;
52
53/// Prelude module for convenient imports
54pub mod prelude {
55    pub use crate::error::{VectorError, Result};
56    pub use crate::types::*;
57    pub use crate::traits::*;
58    pub use crate::config::*;
59    pub use crate::performance::*;
60}