#[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 more