Skip to main content

MemoryRouter

Trait MemoryRouter 

Source
pub trait MemoryRouter: Send + Sync {
    // Required method
    fn route(&self, query: &str) -> MemoryRoute;

    // Provided method
    fn route_with_confidence(&self, query: &str) -> RoutingDecision { ... }
}
Expand description

Decides which memory backend(s) to query for a given input.

Required Methods§

Source

fn route(&self, query: &str) -> MemoryRoute

Route a query to the appropriate backend(s).

Provided Methods§

Source

fn route_with_confidence(&self, query: &str) -> RoutingDecision

Route with a confidence signal. Default implementation wraps route() with confidence 1.0.

Override this in routers that can express ambiguity (e.g. HeuristicRouter) so that HybridRouter can escalate uncertain decisions to LLM.

Implementors§