pub struct MemoryRuntime {
pub session_store: Box<dyn SessionStore>,
pub semantic_store: Option<Box<dyn SemanticMemory>>,
pub extractor: MemoryExtractor,
pub restore_policy: RestorePolicy,
pub restore_config: RestoreConfig,
}Fields§
§session_store: Box<dyn SessionStore>§semantic_store: Option<Box<dyn SemanticMemory>>§extractor: MemoryExtractor§restore_policy: RestorePolicy§restore_config: RestoreConfigImplementations§
Source§impl MemoryRuntime
impl MemoryRuntime
pub fn new( session_store: Box<dyn SessionStore>, semantic_store: Option<Box<dyn SemanticMemory>>, extractor: MemoryExtractor, restore_policy: RestorePolicy, ) -> Self
Sourcepub fn on_run_start(&self, session_id: &str, _goal: &str) -> Vec<Message>
pub fn on_run_start(&self, session_id: &str, _goal: &str) -> Vec<Message>
Load session history and apply restore policy to build initial context.
Sourcepub fn on_turn_end(&mut self, user_msg: &Message, assistant_msg: &Message)
pub fn on_turn_end(&mut self, user_msg: &Message, assistant_msg: &Message)
Extract memories from the current turn and store in semantic memory.
Sourcepub fn on_tool_result(&mut self, _tool_name: &str, result: &str)
pub fn on_tool_result(&mut self, _tool_name: &str, result: &str)
Optionally store a tool result in semantic memory.
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryRuntime
impl !UnwindSafe for MemoryRuntime
impl Freeze for MemoryRuntime
impl Send for MemoryRuntime
impl Sync for MemoryRuntime
impl Unpin for MemoryRuntime
impl UnsafeUnpin for MemoryRuntime
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