lumen-rag 0.2.1

A modular, database-agnostic RAG framework for Rust supporting MongoDB, Qdrant, and SAP HANA Cloud.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use async_trait::async_trait;
use crate::types::Passage;
use anyhow::Result;

/// A trait defining the capabilities of a vector database backend.
#[async_trait]
pub trait VectorStore: Send + Sync {
    /// Ingests a list of passages into the store.
    async fn add_passages(&self, passages: Vec<Passage>) -> Result<Vec<String>>;

    /// Searches for the nearest neighbors given a query embedding.
    async fn search(
        &self,
        query_embedding: &[f32],
        limit: usize
    ) -> Result<Vec<Passage>>;
}