#[non_exhaustive]pub struct RecallOptions<'a> {
pub query: &'a str,
pub query_embedding: Option<&'a [f32]>,
pub limit: usize,
pub min_confidence: Option<f32>,
pub confidence_filter_mode: ConfidenceFilterMode,
pub max_scored_rows: usize,
}Expand description
Options for recall queries, controlling retrieval behaviour.
Use RecallOptions::new to create with defaults, then chain builder
methods to customise. The #[non_exhaustive] attribute ensures new
fields can be added without breaking existing callers.
use kronroe_agent_memory::RecallOptions;
let opts = RecallOptions::new("what does alice do?")
.with_limit(5)
.with_min_confidence(0.6)
.with_max_scored_rows(2_048);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.query: &'a strThe search query text.
query_embedding: Option<&'a [f32]>Optional embedding for hybrid retrieval.
limit: usizeMaximum number of results to return (default: 10).
min_confidence: Option<f32>Minimum confidence threshold — facts below this are filtered out.
confidence_filter_mode: ConfidenceFilterModeWhich confidence signal to use when applying min_confidence.
max_scored_rows: usizeMaximum rows fetched per confidence-filtered recall batch (default: 4,096).
Raising this increases recall depth at the cost of larger per-call work. Lowering it improves bounded latency but may reduce results if strong hits appear deeper in the result ranking.
Implementations§
Source§impl<'a> RecallOptions<'a>
impl<'a> RecallOptions<'a>
Sourcepub fn new(query: &'a str) -> Self
pub fn new(query: &'a str) -> Self
Create options with defaults: limit=10, no embedding, no confidence filter.
Sourcepub fn with_embedding(self, embedding: &'a [f32]) -> Self
pub fn with_embedding(self, embedding: &'a [f32]) -> Self
Set the query embedding for hybrid retrieval.
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Set the maximum number of results.
Sourcepub fn with_min_confidence(self, min: f32) -> Self
pub fn with_min_confidence(self, min: f32) -> Self
Set a minimum confidence threshold to filter low-confidence facts.
Sourcepub fn with_max_scored_rows(self, max_scored_rows: usize) -> Self
pub fn with_max_scored_rows(self, max_scored_rows: usize) -> Self
Set the maximum rows fetched per batch while applying confidence filters.
Must be at least 1; recall_scored_with_options returns a Search error
for non-positive values.
Trait Implementations§
Source§impl<'a> Clone for RecallOptions<'a>
impl<'a> Clone for RecallOptions<'a>
Source§fn clone(&self) -> RecallOptions<'a>
fn clone(&self) -> RecallOptions<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for RecallOptions<'a>
impl<'a> RefUnwindSafe for RecallOptions<'a>
impl<'a> Send for RecallOptions<'a>
impl<'a> Sync for RecallOptions<'a>
impl<'a> Unpin for RecallOptions<'a>
impl<'a> UnsafeUnpin for RecallOptions<'a>
impl<'a> UnwindSafe for RecallOptions<'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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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