pub enum RememberResult {
Created(MemoryRecord),
Duplicate {
existing: MemoryRecord,
similarity: f32,
},
Updated(MemoryRecord),
}Expand description
Result of a remember operation, indicating whether the memory was newly created or deduplicated against an existing memory.
Variants§
Created(MemoryRecord)
A new memory was created.
Duplicate
A duplicate was detected (cosine similarity > threshold). The existing memory was reinforced instead of creating a new one.
Updated(MemoryRecord)
An existing fact with the same subject+relation was updated (upsert).
Implementations§
Source§impl RememberResult
impl RememberResult
Sourcepub fn memory(&self) -> &MemoryRecord
pub fn memory(&self) -> &MemoryRecord
Returns the memory record regardless of whether it was new, duplicate, or updated.
Sourcepub fn is_duplicate(&self) -> bool
pub fn is_duplicate(&self) -> bool
Returns true if this was a duplicate detection.
Sourcepub fn is_updated(&self) -> bool
pub fn is_updated(&self) -> bool
Returns true if this was an upsert (existing fact updated).
Trait Implementations§
Source§impl Clone for RememberResult
impl Clone for RememberResult
Source§fn clone(&self) -> RememberResult
fn clone(&self) -> RememberResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RememberResult
impl Debug for RememberResult
Auto Trait Implementations§
impl Freeze for RememberResult
impl RefUnwindSafe for RememberResult
impl Send for RememberResult
impl Sync for RememberResult
impl Unpin for RememberResult
impl UnsafeUnpin for RememberResult
impl UnwindSafe for RememberResult
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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