pub struct SemanticMemory { /* private fields */ }Expand description
Semantic memory for agent knowledge
Implementations§
Source§impl SemanticMemory
impl SemanticMemory
Sourcepub async fn store_fact(&self, fact: Fact) -> RragResult<()>
pub async fn store_fact(&self, fact: Fact) -> RragResult<()>
Store a fact
Sourcepub async fn delete_fact(&self, fact_id: &str) -> RragResult<bool>
pub async fn delete_fact(&self, fact_id: &str) -> RragResult<bool>
Delete a fact
Sourcepub async fn find_by_subject(&self, subject: &str) -> RragResult<Vec<Fact>>
pub async fn find_by_subject(&self, subject: &str) -> RragResult<Vec<Fact>>
Find facts by subject
Sourcepub async fn find_by_predicate(&self, predicate: &str) -> RragResult<Vec<Fact>>
pub async fn find_by_predicate(&self, predicate: &str) -> RragResult<Vec<Fact>>
Find facts by predicate
Sourcepub async fn find_by_subject_and_predicate(
&self,
subject: &str,
predicate: &str,
) -> RragResult<Vec<Fact>>
pub async fn find_by_subject_and_predicate( &self, subject: &str, predicate: &str, ) -> RragResult<Vec<Fact>>
Find facts by subject and predicate
Sourcepub async fn get_all_facts(&self) -> RragResult<Vec<Fact>>
pub async fn get_all_facts(&self) -> RragResult<Vec<Fact>>
Get all facts
Sourcepub async fn count(&self) -> RragResult<usize>
pub async fn count(&self) -> RragResult<usize>
Count facts
Sourcepub async fn clear(&self) -> RragResult<()>
pub async fn clear(&self) -> RragResult<()>
Clear all facts
Auto Trait Implementations§
impl Freeze for SemanticMemory
impl !RefUnwindSafe for SemanticMemory
impl Send for SemanticMemory
impl Sync for SemanticMemory
impl Unpin for SemanticMemory
impl !UnwindSafe for SemanticMemory
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