pub struct MemoryRecord {Show 29 fields
pub id: Uuid,
pub agent_id: String,
pub content: String,
pub memory_type: MemoryType,
pub scope: Scope,
pub importance: f32,
pub tags: Vec<String>,
pub metadata: Value,
pub embedding: Option<Vec<f32>>,
pub content_hash: Vec<u8>,
pub prev_hash: Option<Vec<u8>>,
pub source_type: SourceType,
pub source_id: Option<String>,
pub consolidation_state: ConsolidationState,
pub access_count: u64,
pub org_id: Option<String>,
pub thread_id: Option<String>,
pub created_at: String,
pub updated_at: String,
pub last_accessed_at: Option<String>,
pub expires_at: Option<String>,
pub deleted_at: Option<String>,
pub decay_rate: Option<f32>,
pub created_by: Option<String>,
pub version: u32,
pub prev_version_id: Option<Uuid>,
pub quarantined: bool,
pub quarantine_reason: Option<String>,
pub decay_function: Option<String>,
}Fields§
§id: Uuid§agent_id: String§content: String§memory_type: MemoryType§scope: Scope§importance: f32§metadata: Value§embedding: Option<Vec<f32>>§content_hash: Vec<u8>§prev_hash: Option<Vec<u8>>§source_type: SourceType§source_id: Option<String>§consolidation_state: ConsolidationState§access_count: u64§org_id: Option<String>§thread_id: Option<String>§created_at: String§updated_at: String§last_accessed_at: Option<String>§expires_at: Option<String>§deleted_at: Option<String>§decay_rate: Option<f32>§created_by: Option<String>§version: u32§prev_version_id: Option<Uuid>§quarantined: bool§quarantine_reason: Option<String>§decay_function: Option<String>Implementations§
Source§impl MemoryRecord
impl MemoryRecord
Sourcepub fn new(agent_id: String, content: String) -> Self
pub fn new(agent_id: String, content: String) -> Self
Create a new MemoryRecord with sensible defaults.
Only agent_id and content are required; all other fields use defaults.
Sourcepub fn from_parts(
id: Uuid,
agent_id: String,
content: String,
memory_type: MemoryType,
scope: Scope,
importance: f32,
tags: Vec<String>,
metadata: Value,
embedding: Option<Vec<f32>>,
content_hash: Vec<u8>,
prev_hash: Option<Vec<u8>>,
source_type: SourceType,
source_id: Option<String>,
consolidation_state: ConsolidationState,
access_count: u64,
org_id: Option<String>,
thread_id: Option<String>,
created_at: String,
updated_at: String,
last_accessed_at: Option<String>,
expires_at: Option<String>,
deleted_at: Option<String>,
decay_rate: Option<f32>,
created_by: Option<String>,
version: u32,
prev_version_id: Option<Uuid>,
quarantined: bool,
quarantine_reason: Option<String>,
decay_function: Option<String>,
) -> Self
pub fn from_parts( id: Uuid, agent_id: String, content: String, memory_type: MemoryType, scope: Scope, importance: f32, tags: Vec<String>, metadata: Value, embedding: Option<Vec<f32>>, content_hash: Vec<u8>, prev_hash: Option<Vec<u8>>, source_type: SourceType, source_id: Option<String>, consolidation_state: ConsolidationState, access_count: u64, org_id: Option<String>, thread_id: Option<String>, created_at: String, updated_at: String, last_accessed_at: Option<String>, expires_at: Option<String>, deleted_at: Option<String>, decay_rate: Option<f32>, created_by: Option<String>, version: u32, prev_version_id: Option<Uuid>, quarantined: bool, quarantine_reason: Option<String>, decay_function: Option<String>, ) -> Self
Create a MemoryRecord with all fields specified.
Intended for storage backends that reconstruct records from database rows.
pub fn is_deleted(&self) -> bool
Trait Implementations§
Source§impl Clone for MemoryRecord
impl Clone for MemoryRecord
Source§fn clone(&self) -> MemoryRecord
fn clone(&self) -> MemoryRecord
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 MemoryRecord
impl Debug for MemoryRecord
Source§impl<'de> Deserialize<'de> for MemoryRecord
impl<'de> Deserialize<'de> for MemoryRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MemoryRecord
impl PartialEq for MemoryRecord
Source§impl Serialize for MemoryRecord
impl Serialize for MemoryRecord
impl StructuralPartialEq for MemoryRecord
Auto Trait Implementations§
impl Freeze for MemoryRecord
impl RefUnwindSafe for MemoryRecord
impl Send for MemoryRecord
impl Sync for MemoryRecord
impl Unpin for MemoryRecord
impl UnsafeUnpin for MemoryRecord
impl UnwindSafe for MemoryRecord
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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