pub struct MultiMemory {
pub short_term: Arc<ShortTermMemory>,
pub long_term: Arc<LongTermMemory>,
pub entity: Arc<EntityMemory>,
/* private fields */
}Expand description
Unified multi-memory system combining all memory types
Fields§
§short_term: Arc<ShortTermMemory>Short-term memory for recent context
long_term: Arc<LongTermMemory>Long-term memory for persistent knowledge
entity: Arc<EntityMemory>Entity memory for structured knowledge
Implementations§
Source§impl MultiMemory
impl MultiMemory
pub fn new(config: MemoryConfig) -> Self
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Create with default configuration
Sourcepub fn recall(
&self,
query: &str,
query_embedding: Option<&[f32]>,
limit: usize,
) -> RecallResult
pub fn recall( &self, query: &str, query_embedding: Option<&[f32]>, limit: usize, ) -> RecallResult
Recall relevant memories for a query
Sourcepub fn build_context(
&self,
query: &str,
query_embedding: Option<&[f32]>,
max_short_term: usize,
max_long_term: usize,
) -> String
pub fn build_context( &self, query: &str, query_embedding: Option<&[f32]>, max_short_term: usize, max_long_term: usize, ) -> String
Build context string from memories
Sourcepub fn stats(&self) -> MemoryStats
pub fn stats(&self) -> MemoryStats
Get memory statistics
Auto Trait Implementations§
impl Freeze for MultiMemory
impl !RefUnwindSafe for MultiMemory
impl Send for MultiMemory
impl Sync for MultiMemory
impl Unpin for MultiMemory
impl UnsafeUnpin for MultiMemory
impl !UnwindSafe for MultiMemory
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