pub struct MultiSourceRetriever { /* private fields */ }Expand description
Multi-source retriever that combines vector, graph, and table queries
Implementations§
Source§impl MultiSourceRetriever
impl MultiSourceRetriever
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 multi-source retriever
Sourcepub fn retrieve(
&self,
query: &str,
analysis: &QueryAnalysis,
config: &RagConfig,
) -> Result<RetrievalContext, ExecutionError>
pub fn retrieve( &self, query: &str, analysis: &QueryAnalysis, config: &RagConfig, ) -> Result<RetrievalContext, ExecutionError>
Retrieve context based on query analysis
Sourcepub fn retrieve_by_vector(
&self,
vector: &[f32],
collection: &str,
k: usize,
config: &RagConfig,
) -> Result<RetrievalContext, ExecutionError>
pub fn retrieve_by_vector( &self, vector: &[f32], collection: &str, k: usize, config: &RagConfig, ) -> Result<RetrievalContext, ExecutionError>
Retrieve context by vector directly
Sourcepub fn expand_context(
&self,
entity_id: &str,
entity_type: EntityType,
depth: u32,
config: &RagConfig,
) -> Result<RetrievalContext, ExecutionError>
pub fn expand_context( &self, entity_id: &str, entity_type: EntityType, depth: u32, config: &RagConfig, ) -> 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>
Find similar entities by vector
Auto Trait Implementations§
impl Freeze for MultiSourceRetriever
impl RefUnwindSafe for MultiSourceRetriever
impl Send for MultiSourceRetriever
impl Sync for MultiSourceRetriever
impl Unpin for MultiSourceRetriever
impl UnsafeUnpin for MultiSourceRetriever
impl UnwindSafe for MultiSourceRetriever
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