pub enum CardSelection {
EntityMentions,
RecentCards,
ForPrincipal(String),
PreferencesFor(Vec<String>),
}Expand description
Strategy for choosing which memory cards to surface as context.
Each variant resolves a query into a list of cards using only the
local store — no LLM, no NER. Build your own MemoryCardContext
implementation if you need fancier extraction.
Variants§
EntityMentions
Pull cards for entities whose names appear (case-insensitive, word-boundary-aware) in the query string. Cheap, deterministic, and zero-dependency. The default and the right choice for most chatbots.
RecentCards
Always include the most recently-written cards, ignoring the query entirely. Useful as a “what does the agent know about the user right now” preamble that doesn’t depend on lexical overlap.
ForPrincipal(String)
Always include cards for the named principal/entity, ignoring the query text. This is useful for personal assistants where follow-up questions often say “what should I avoid?” without repeating the user’s name.
PreferencesFor(Vec<String>)
Always include preference-kind cards for the listed entities.
Combine with Self::EntityMentions in your own selection
strategy if you need both.
Trait Implementations§
Source§impl Clone for CardSelection
impl Clone for CardSelection
Source§fn clone(&self) -> CardSelection
fn clone(&self) -> CardSelection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CardSelection
impl Debug for CardSelection
Source§impl Default for CardSelection
impl Default for CardSelection
Source§fn default() -> CardSelection
fn default() -> CardSelection
Auto Trait Implementations§
impl Freeze for CardSelection
impl RefUnwindSafe for CardSelection
impl Send for CardSelection
impl Sync for CardSelection
impl Unpin for CardSelection
impl UnsafeUnpin for CardSelection
impl UnwindSafe for CardSelection
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> 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> 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