pub struct QueryPlanner { /* private fields */ }Expand description
Query planner that coordinates multi-dimensional retrieval
Implementations§
Source§impl QueryPlanner
impl QueryPlanner
Sourcepub fn new(
storage: Arc<StorageEngine>,
vector_index: Arc<RwLock<VectorIndex>>,
bm25_index: Arc<BM25Index>,
temporal_index: Arc<TemporalIndex>,
graph_manager: Arc<RwLock<GraphManager>>,
fusion_semantic_threshold: f32,
semantic_prefilter_threshold: f32,
fusion_strategy: FusionStrategy,
rrf_k: f32,
slm_query_classification_enabled: bool,
adaptive_k_threshold: f32,
) -> Result<Self>
pub fn new( storage: Arc<StorageEngine>, vector_index: Arc<RwLock<VectorIndex>>, bm25_index: Arc<BM25Index>, temporal_index: Arc<TemporalIndex>, graph_manager: Arc<RwLock<GraphManager>>, fusion_semantic_threshold: f32, semantic_prefilter_threshold: f32, fusion_strategy: FusionStrategy, rrf_k: f32, slm_query_classification_enabled: bool, adaptive_k_threshold: f32, ) -> Result<Self>
Create a new query planner
Sourcepub fn query(
&self,
query_text: &str,
query_embedding: &[f32],
limit: usize,
namespace: Option<&str>,
filters: Option<&[MetadataFilter]>,
user_entity: Option<&str>,
trace: Option<&mut TraceRecorder>,
) -> Result<(IntentClassification, Vec<FusedResult>, Vec<MatchedProfileFact>)>
pub fn query( &self, query_text: &str, query_embedding: &[f32], limit: usize, namespace: Option<&str>, filters: Option<&[MetadataFilter]>, user_entity: Option<&str>, trace: Option<&mut TraceRecorder>, ) -> Result<(IntentClassification, Vec<FusedResult>, Vec<MatchedProfileFact>)>
Execute a multi-dimensional query
Classifies the query intent, retrieves results from relevant dimensions, and fuses them with adaptive weights.
§Arguments
query_text- The natural language queryquery_embedding- Vector embedding of the querylimit- Maximum number of results to returnnamespace- Optional namespace filter. If provided, only returns memories in this namespacefilters- Optional metadata filters. All filters must match (AND logic)user_entity- Optional user identity for first-person pronoun resolution. When set, queries containing “I”, “me”, “my”, etc. automatically include this entity in profile injection. Standard in conversational memory systems where the user’s own memories are stored under their name but queries use first-person pronouns.
§Returns
Tuple of (intent classification, fused results)
Sourcepub fn temporal_range_query(
&self,
start: Timestamp,
end: Timestamp,
limit: usize,
namespace: Option<&str>,
) -> Result<Vec<FusedResult>>
pub fn temporal_range_query( &self, start: Timestamp, end: Timestamp, limit: usize, namespace: Option<&str>, ) -> Result<Vec<FusedResult>>
Perform temporal range search
Search memories within a specific time range
§Arguments
start- Start of time rangeend- End of time rangelimit- Maximum number of resultsnamespace- Optional namespace filter
Auto Trait Implementations§
impl Freeze for QueryPlanner
impl !RefUnwindSafe for QueryPlanner
impl Send for QueryPlanner
impl Sync for QueryPlanner
impl Unpin for QueryPlanner
impl UnsafeUnpin for QueryPlanner
impl !UnwindSafe for QueryPlanner
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