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>,
) -> Self
pub fn new( graph: Arc<GraphStore>, index: Arc<GraphTableIndex>, vector_store: Arc<VectorStore>, unified_index: Arc<UnifiedIndex>, ) -> Self
Create a new RAG engine with all storage backends
Sourcepub fn with_config(self, config: RagConfig) -> Self
pub fn with_config(self, config: RagConfig) -> Self
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 Forget for RagEngine
impl Freeze for RagEnginewhere
*const ArcInner<GraphStore> is !null: Freeze,
PhantomData<ArcInner<GraphStore>>: Freeze,
*const ArcInner<GraphTableIndex> is !null: Freeze,
PhantomData<ArcInner<GraphTableIndex>>: Freeze,
*const ArcInner<VectorStore> is !null: Freeze,
PhantomData<ArcInner<VectorStore>>: Freeze,
*const ArcInner<UnifiedIndex> is !null: Freeze,
PhantomData<ArcInner<UnifiedIndex>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<&'static str>: Freeze,
impl Move for RagEngine
impl RefUnwindSafe for RagEnginewhere
Atomic<usize>: RefUnwindSafe,
RwLock<HashMap<String, RecordLocation>>: RefUnwindSafe,
RwLock<HashMap<String, Vec<(String, String, f32)>>>: RefUnwindSafe,
RwLock<HashMap<LabelId, HashSet<String>>>: RefUnwindSafe,
RwLock<HashMap<String, HashSet<String>>>: RefUnwindSafe,
RwLock<BloomSegment>: RefUnwindSafe,
RwLock<usize>: RefUnwindSafe,
RwLock<RegistryInner>: RefUnwindSafe,
RwLock<Vec<Page>>: RefUnwindSafe,
Atomic<u32>: RefUnwindSafe,
Atomic<u64>: RefUnwindSafe,
RwLock<HashMap<String, TableRef>>: RefUnwindSafe,
RwLock<HashMap<RowKey, String>>: RefUnwindSafe,
RwLock<HashMap<String, Vec<VectorKey>>>: RefUnwindSafe,
RwLock<HashMap<VectorKey, String>>: RefUnwindSafe,
RwLock<HashMap<String, Vec<RowKey>>>: RefUnwindSafe,
RwLock<HashMap<RowKey, String>>: RefUnwindSafe,
RwLock<HashMap<String, (String, String)>>: RefUnwindSafe,
RwLock<HashMap<VectorKey, RowKey>>: RefUnwindSafe,
RwLock<HashMap<RowKey, Vec<VectorKey>>>: RefUnwindSafe,
impl Send for RagEnginewhere
Arc<GraphStore>: Send,
Arc<GraphTableIndex>: Send,
Arc<VectorStore>: Send,
Arc<UnifiedIndex>: Send,
RawVecInner: Send,
&'static str: Send,
impl Sync for RagEnginewhere
Arc<GraphStore>: Sync,
Arc<GraphTableIndex>: Sync,
Arc<VectorStore>: Sync,
Arc<UnifiedIndex>: Sync,
RawVecInner: Sync,
impl Unpin for RagEnginewhere
Arc<GraphStore>: Unpin,
Arc<GraphTableIndex>: Unpin,
Arc<VectorStore>: Unpin,
Arc<UnifiedIndex>: Unpin,
*const u8 is !null: Unpin,
&'static str: Unpin,
impl UnsafeUnpin for RagEnginewhere
*const ArcInner<GraphStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<GraphStore>>: UnsafeUnpin,
*const ArcInner<GraphTableIndex> is !null: UnsafeUnpin,
PhantomData<ArcInner<GraphTableIndex>>: UnsafeUnpin,
*const ArcInner<VectorStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<VectorStore>>: UnsafeUnpin,
*const ArcInner<UnifiedIndex> is !null: UnsafeUnpin,
PhantomData<ArcInner<UnifiedIndex>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<&'static str>: UnsafeUnpin,
impl UnwindSafe for RagEnginewhere
Arc<GraphStore>: UnwindSafe,
Arc<GraphTableIndex>: UnwindSafe,
Arc<VectorStore>: UnwindSafe,
Arc<UnifiedIndex>: UnwindSafe,
RawVecInner: UnwindSafe,
&'static str: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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