Skip to main content

RecallOptions

Struct RecallOptions 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§query: &'a str

The search query text.

§query_embedding: Option<&'a [f32]>

Optional embedding for hybrid retrieval.

§limit: usize

Maximum number of results to return (default: 10).

§min_confidence: Option<f32>

Minimum confidence threshold — facts below this are filtered out.

§confidence_filter_mode: ConfidenceFilterMode

Which confidence signal to use when applying min_confidence.

§max_scored_rows: usize

Maximum 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>

Source

pub fn new(query: &'a str) -> Self

Create options with defaults: limit=10, no embedding, no confidence filter.

Source

pub fn with_embedding(self, embedding: &'a [f32]) -> Self

Set the query embedding for hybrid retrieval.

Source

pub fn with_limit(self, limit: usize) -> Self

Set the maximum number of results.

Source

pub fn with_min_confidence(self, min: f32) -> Self

Set a minimum confidence threshold to filter low-confidence facts.

Source

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>

Source§

fn clone(&self) -> RecallOptions<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for RecallOptions<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.