pub struct MemoryStore { /* private fields */ }Implementations§
Source§impl MemoryStore
impl MemoryStore
pub fn new(config: &MemoryConfig) -> Result<Self>
pub fn new_in_memory(embedding_dimension: usize) -> Result<Self>
pub fn insert(&self, entry: &MemoryEntry, embedding: &[f32]) -> Result<()>
pub fn store_text_only(&self, entry: &MemoryEntry) -> Result<i64>
pub fn update_embedding(&self, id: i64, embedding: &[f32]) -> Result<()>
pub fn get(&self, id: &str) -> Result<Option<MemoryEntry>>
pub fn delete(&self, id: &str) -> Result<bool>
pub fn delete_by_ids(&self, ids: &[String]) -> Result<usize>
pub fn list( &self, container_tag: Option<&str>, limit: usize, ) -> Result<Vec<MemoryEntry>>
pub fn vector_search( &self, embedding: &[f32], limit: usize, ) -> Result<Vec<(String, f32)>>
pub fn fts_search( &self, query: &str, limit: usize, ) -> Result<Vec<(String, f64)>>
pub fn get_cached_embedding( &self, content_hash: &str, ) -> Result<Option<Vec<f32>>>
pub fn cache_embedding( &self, content_hash: &str, embedding: &[f32], model: &str, ) -> Result<()>
pub fn add_profile_fact(&self, fact: &UserProfileFact) -> Result<()>
pub fn get_profile_facts( &self, fact_type: Option<&str>, ) -> Result<Vec<UserProfileFact>>
pub fn remove_profile_fact(&self, id: &str) -> Result<bool>
pub fn stats(&self) -> Result<MemoryStats>
pub fn count(&self) -> Result<usize>
pub fn cleanup( &self, container_tag: &str, retention_days: Option<u32>, max_memories: Option<usize>, ) -> Result<usize>
Auto Trait Implementations§
impl !Freeze for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
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