Crate lumosai_vector_core

Source
Expand description

§Lumos Vector Core

Core abstractions and traits for the Lumos vector storage system. This crate provides the foundational types and interfaces that all vector storage implementations must follow.

§Design Philosophy

This crate is inspired by the excellent designs of:

  • Rig: Strong typing and trait-based abstractions
  • Mastra: Declarative configuration and modularity
  • Lumos: Enterprise features and performance

§Core Concepts

  • VectorStorage: The main trait for vector storage backends
  • EmbeddingModel: Trait for embedding generation
  • Document: Unified document representation with embedding support
  • SearchRequest/Response: Structured query interface

§Example

use lumosai_vector_core::prelude::*;
use std::collections::HashMap;

// Create a document with embedding support
let doc = Document::new("doc1", "This is a test document")
    .with_embedding(vec![0.1, 0.2, 0.3])
    .with_metadata("type", "article");

// Create an index configuration
let config = IndexConfig::new("test_index", 384)
    .with_metric(SimilarityMetric::Cosine);

Re-exports§

pub use error::VectorError;
pub use error::Result;
pub use types::*;
pub use traits::*;
pub use config::*;
pub use performance::*;

Modules§

config
Configuration types for the Lumos vector storage system
error
Error types for the Lumos vector storage system
performance
性能优化模块
prelude
Prelude module for convenient imports
traits
Core traits for the Lumos vector storage system
types
Core types for the Lumos vector storage system