Skip to main content

QueryPlanner

Struct QueryPlanner 

Source
pub struct QueryPlanner { /* private fields */ }
Expand description

Query planner that coordinates multi-dimensional retrieval

Implementations§

Source§

impl QueryPlanner

Source

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

Source

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 query
  • query_embedding - Vector embedding of the query
  • limit - Maximum number of results to return
  • namespace - Optional namespace filter. If provided, only returns memories in this namespace
  • filters - 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)

Source

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 range
  • end - End of time range
  • limit - Maximum number of results
  • namespace - Optional namespace filter

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more