use async_trait::async_trait; use uuid::Uuid; use super::rag_document::RagDocument; use imphnen_utils::AppError; #[async_trait] pub trait RagRepository: Send + Sync { /// Upsert a document chunk into the vector store. async fn upsert_document( &self, point_id: u64, doc: &RagDocument, embedding: Vec, ) -> Result<(), AppError>; /// Search the vector store for the closest chunks to `embedding`. async fn search( &self, embedding: Vec, limit: u64, material_id: Option, ) -> Result, AppError>; /// Remove all chunks for a material (re-index support). async fn delete_material(&self, material_id: Uuid) -> Result<(), AppError>; }