pub struct HybridStore { /* private fields */ }Expand description
Executes hybrid graph + vector queries.
Implementations§
Source§impl HybridStore
impl HybridStore
Sourcepub fn query(
&self,
q: HybridQuery<'_>,
col: &Collection,
) -> Result<Vec<HybridResult>>
pub fn query( &self, q: HybridQuery<'_>, col: &Collection, ) -> Result<Vec<HybridResult>>
Run a hybrid graph + vector query.
The algorithm proceeds in three stages:
- Graph traversal — walks the memory graph from
q.anchor_nodeup toq.graph_depthhops, recording the maximum edge weight seen for each reachable node. - Vector search — retrieves the top
q.top_k × 20approximate nearest neighbours from the named collection. - Score blending — for each candidate, computes
rank = q.alpha × vec_similarity + (1 − q.alpha) × graph_weight, then returns the topq.top_kresults sorted by rank descending.
Sourcepub fn tri_modal_query(
&self,
q: &TriModalQuery,
col: &Collection,
) -> Result<Vec<TriModalResult>>
pub fn tri_modal_query( &self, q: &TriModalQuery, col: &Collection, ) -> Result<Vec<TriModalResult>>
Run a tri-modal graph + vector + FTS query.
The algorithm runs three searches and blends results:
- Vector ANN — retrieves
top_k × 20approximate nearest neighbours. - Graph traversal — walks the memory graph from
q.anchor_nodeup toq.graph_depthhops, recording the maximum edge weight per reachable node. - FTS keyword search — BM25 full-text search over the collection’s FTS index.
Each component is min-max normalised to [0, 1] within its own result set, then
blended as final_score = alpha × vec_score + beta × graph_weight + gamma × fts_score.
The weights must satisfy alpha + beta + gamma ≈ 1.0 (tolerance ±0.01).
Auto Trait Implementations§
impl Freeze for HybridStore
impl RefUnwindSafe for HybridStore
impl Send for HybridStore
impl Sync for HybridStore
impl Unpin for HybridStore
impl UnsafeUnpin for HybridStore
impl UnwindSafe for HybridStore
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