pub struct RetrievalOptions<'a> {
pub top_k: Option<usize>,
pub confidence_map: Option<&'a HashMap<String, f64>>,
pub eligible_skill_ids: Option<&'a HashSet<String>>,
pub age_days_map: Option<&'a HashMap<String, f32>>,
pub target_file: Option<&'a str>,
pub filter: Option<&'a QueryFilter>,
pub ann_enabled: bool,
pub embedding_timeout: Option<Duration>,
pub cold_start_retry: bool,
pub adaptive_prune: bool,
pub trajectory: Option<&'a mut TrajectoryBuilder>,
}Expand description
Retrieve rules with confidence weighting plus hybrid FTS / embedding retrieval.
Retrieval options for confidence weighting, scoping, ANN usage, and trajectory telemetry. The default path matches plain retrieval: default top-k, no confidence map, no target-file cascade, no SQL metadata filter, ANN enabled, and no trajectory capture.
Fields§
§top_k: Option<usize>§confidence_map: Option<&'a HashMap<String, f64>>§eligible_skill_ids: Option<&'a HashSet<String>>Optional allow-list applied before RRF fusion. Callers that already know the engine-eligible rule set can pass it here so disabled rules do not consume top-k score budget.
age_days_map: Option<&'a HashMap<String, f32>>Iter-13 (2026-05-02). Per-skill age in days, used by the
category-keyed half-life decay in effective_confidence. When
None (or a chunk’s skill_id is absent from the map) the
scoring site uses age_days = 0.0 — identical to the
pre-plumbing behaviour, so no caller breaks if it doesn’t pass
a map.
target_file: Option<&'a str>§filter: Option<&'a QueryFilter>§ann_enabled: bool§embedding_timeout: Option<Duration>Optional provider-call budget for embedding the query. Latency- sensitive hook paths set this so a slow cloud embedder degrades to lexical retrieval instead of timing out the host agent’s hook.
cold_start_retry: boolWhen true, a query embed that falls back to lexical because the base
budget timed out on a healthy cloud lane is retried once with a longer
cold-absorbing budget (see [COLD_RETRY_EMBEDDING_TIMEOUT]). Only the
human-waiting CLI recall/search path sets this; the latency-critical
hook/MCP paths leave it false so a cold provider never blocks the agent.
adaptive_prune: boolWhen true, suppresses broad weak matches entirely. This is useful for unsolicited hook injection where “no extra context” is often better than five noisy rules. Explicit user/tool queries should leave this false so a search never looks broken just because the best match is weak.
trajectory: Option<&'a mut TrajectoryBuilder>Trait Implementations§
Auto Trait Implementations§
impl<'a> !UnwindSafe for RetrievalOptions<'a>
impl<'a> Freeze for RetrievalOptions<'a>
impl<'a> RefUnwindSafe for RetrievalOptions<'a>
impl<'a> Send for RetrievalOptions<'a>
impl<'a> Sync for RetrievalOptions<'a>
impl<'a> Unpin for RetrievalOptions<'a>
impl<'a> UnsafeUnpin for RetrievalOptions<'a>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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 more