lumen-rag 0.3.0

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
use crate::types::Passage;
use anyhow::Result;
use async_trait::async_trait;

/// 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>>;
}