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>,
) -> MultiSourceRetriever
pub fn new( graph: Arc<GraphStore>, index: Arc<GraphTableIndex>, vector_store: Arc<VectorStore>, unified_index: Arc<UnifiedIndex>, ) -> MultiSourceRetriever
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 Forget for MultiSourceRetriever
impl Freeze for MultiSourceRetrieverwhere
*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,
impl Move for MultiSourceRetriever
impl RefUnwindSafe for MultiSourceRetrieverwhere
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 MultiSourceRetrieverwhere
Arc<GraphStore>: Send,
Arc<GraphTableIndex>: Send,
Arc<VectorStore>: Send,
Arc<UnifiedIndex>: Send,
impl Sync for MultiSourceRetrieverwhere
Arc<GraphStore>: Sync,
Arc<GraphTableIndex>: Sync,
Arc<VectorStore>: Sync,
Arc<UnifiedIndex>: Sync,
impl Unpin for MultiSourceRetrieverwhere
Arc<GraphStore>: Unpin,
Arc<GraphTableIndex>: Unpin,
Arc<VectorStore>: Unpin,
Arc<UnifiedIndex>: Unpin,
impl UnsafeUnpin for MultiSourceRetrieverwhere
*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,
impl UnwindSafe for MultiSourceRetrieverwhere
Arc<GraphStore>: UnwindSafe,
Arc<GraphTableIndex>: UnwindSafe,
Arc<VectorStore>: UnwindSafe,
Arc<UnifiedIndex>: 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