pub struct StoreMemoryRequest {
pub agent_id: String,
pub content: String,
pub memory_type: MemoryType,
pub importance: f32,
pub tags: Vec<String>,
pub session_id: Option<String>,
pub metadata: Option<Value>,
pub ttl_seconds: Option<u64>,
pub expires_at: Option<u64>,
}Expand description
Store a memory request
Fields§
§agent_id: String§content: String§memory_type: MemoryType§importance: f32§session_id: Option<String>§metadata: Option<Value>§ttl_seconds: Option<u64>Optional TTL in seconds. The memory is hard-deleted after this many seconds from creation.
expires_at: Option<u64>Optional explicit expiry as a Unix timestamp (seconds). Takes precedence
over ttl_seconds when both are set. The memory is hard-deleted by the
decay engine on expiry (DECAY-3).
Implementations§
Source§impl StoreMemoryRequest
impl StoreMemoryRequest
Sourcepub fn new(agent_id: impl Into<String>, content: impl Into<String>) -> Self
pub fn new(agent_id: impl Into<String>, content: impl Into<String>) -> Self
Create a new store memory request
Sourcepub fn with_type(self, memory_type: MemoryType) -> Self
pub fn with_type(self, memory_type: MemoryType) -> Self
Set memory type
Sourcepub fn with_importance(self, importance: f32) -> Self
pub fn with_importance(self, importance: f32) -> Self
Set importance score
Set tags
Sourcepub fn with_session(self, session_id: impl Into<String>) -> Self
pub fn with_session(self, session_id: impl Into<String>) -> Self
Set session ID
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Set metadata
Sourcepub fn with_ttl(self, ttl_seconds: u64) -> Self
pub fn with_ttl(self, ttl_seconds: u64) -> Self
Set TTL in seconds. The memory is hard-deleted after this many seconds from creation.
Sourcepub fn with_expires_at(self, expires_at: u64) -> Self
pub fn with_expires_at(self, expires_at: u64) -> Self
Set an explicit expiry Unix timestamp (seconds). Takes precedence over
ttl_seconds when both are set (DECAY-3).
Trait Implementations§
Source§impl Clone for StoreMemoryRequest
impl Clone for StoreMemoryRequest
Source§fn clone(&self) -> StoreMemoryRequest
fn clone(&self) -> StoreMemoryRequest
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 StoreMemoryRequest
impl Debug for StoreMemoryRequest
Source§impl<'de> Deserialize<'de> for StoreMemoryRequest
impl<'de> Deserialize<'de> for StoreMemoryRequest
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
Auto Trait Implementations§
impl Freeze for StoreMemoryRequest
impl RefUnwindSafe for StoreMemoryRequest
impl Send for StoreMemoryRequest
impl Sync for StoreMemoryRequest
impl Unpin for StoreMemoryRequest
impl UnsafeUnpin for StoreMemoryRequest
impl UnwindSafe for StoreMemoryRequest
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