pub struct RagEngine { /* private fields */ }Expand description
The main RAG Engine that orchestrates retrieval
Implementations§
Source§impl RagEngine
impl RagEngine
Sourcepub fn new(
graph: Arc<GraphStore>,
index: Arc<GraphTableIndex>,
vector_store: Arc<VectorStore>,
unified_index: Arc<UnifiedIndex>,
) -> RagEngine
pub fn new( graph: Arc<GraphStore>, index: Arc<GraphTableIndex>, vector_store: Arc<VectorStore>, unified_index: Arc<UnifiedIndex>, ) -> RagEngine
Create a new RAG engine with all storage backends
Sourcepub fn with_config(self, config: RagConfig) -> RagEngine
pub fn with_config(self, config: RagConfig) -> RagEngine
Configure the RAG engine
Sourcepub fn retrieve(&self, query: &str) -> Result<RetrievalContext, ExecutionError>
pub fn retrieve(&self, query: &str) -> Result<RetrievalContext, ExecutionError>
Retrieve context for a query
Sourcepub fn retrieve_with_strategy(
&self,
query: &str,
strategy: RetrievalStrategy,
) -> Result<RetrievalContext, ExecutionError>
pub fn retrieve_with_strategy( &self, query: &str, strategy: RetrievalStrategy, ) -> Result<RetrievalContext, ExecutionError>
Retrieve with explicit strategy override
Sourcepub fn retrieve_by_vector(
&self,
vector: &[f32],
collection: &str,
k: usize,
) -> Result<RetrievalContext, ExecutionError>
pub fn retrieve_by_vector( &self, vector: &[f32], collection: &str, k: usize, ) -> Result<RetrievalContext, ExecutionError>
Retrieve with a query vector (for embedding-based queries)
Sourcepub fn expand_context(
&self,
entity_id: &str,
entity_type: EntityType,
depth: u32,
) -> Result<RetrievalContext, ExecutionError>
pub fn expand_context( &self, entity_id: &str, entity_type: EntityType, depth: u32, ) -> Result<RetrievalContext, ExecutionError>
Expand context around a known entity
Sourcepub fn find_similar(
&self,
collection: &str,
entity_id: u64,
k: usize,
) -> Result<Vec<SimilarEntity>, ExecutionError>
pub fn find_similar( &self, collection: &str, entity_id: u64, k: usize, ) -> Result<Vec<SimilarEntity>, ExecutionError>
Get similar entities by vector
Auto Trait Implementations§
impl Freeze for RagEngine
impl RefUnwindSafe for RagEngine
impl Send for RagEngine
impl Sync for RagEngine
impl Unpin for RagEngine
impl UnsafeUnpin for RagEngine
impl UnwindSafe for RagEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request