pub struct MemoryBuilder { /* private fields */ }Expand description
Builder for Memory.
Implementations§
Source§impl MemoryBuilder
impl MemoryBuilder
Sourcepub fn scorer(self, scorer: Arc<dyn Scorer>) -> Self
pub fn scorer(self, scorer: Arc<dyn Scorer>) -> Self
Replace the ranking (HybridScorer by default).
Sourcepub fn scoring(self, config: ScoringConfig) -> Self
pub fn scoring(self, config: ScoringConfig) -> Self
Keep the default scorer but change its weights and thresholds.
pub fn retention(self, retention: RetentionConfig) -> Self
Sourcepub fn merge(self, merge: MergeConfig) -> Self
pub fn merge(self, merge: MergeConfig) -> Self
When a new fact merges into a near duplicate under another key.
Sourcepub fn scope_resolver(
self,
f: impl Fn(&str) -> String + Send + Sync + 'static,
) -> Self
pub fn scope_resolver( self, f: impl Fn(&str) -> String + Send + Sync + 'static, ) -> Self
How session ids map to scopes (for example, many sessions of one
user sharing telegram:synthetic-user-1).
Sourcepub fn audience_resolver(
self,
f: impl Fn(&str) -> RecallAudience + Send + Sync + 'static,
) -> Self
pub fn audience_resolver( self, f: impl Fn(&str) -> RecallAudience + Send + Sync + 'static, ) -> Self
Who each session’s conversation reaches. A host with shared channels must set this: without it every session counts as the owner in a direct conversation, so only the scope separates them.
Sourcepub fn extractor(self, extractor: FactExtractor) -> Self
pub fn extractor(self, extractor: FactExtractor) -> Self
Enables Memory::ingest_turn / Memory::ingest_run fact
extraction and the crate::MemoryWriter hook.
Sourcepub fn summarizer(self, summarizer: EpisodeSummarizer) -> Self
pub fn summarizer(self, summarizer: EpisodeSummarizer) -> Self
Enables episode summaries in Memory::ingest_run.
pub fn build(self) -> Memory
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryBuilder
impl !UnwindSafe for MemoryBuilder
impl Forget for MemoryBuilder
impl Freeze for MemoryBuilder
impl Move for MemoryBuilder
impl Send for MemoryBuilder
impl Sync for MemoryBuilder
impl Unpin for MemoryBuilder
impl UnsafeUnpin for MemoryBuilder
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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