pub struct Memory { /* private fields */ }Implementations§
Source§impl Memory
impl Memory
Sourcepub fn open(
dir: PathBuf,
config: MemoryConfig,
storage: Box<dyn Storage>,
) -> Self
pub fn open( dir: PathBuf, config: MemoryConfig, storage: Box<dyn Storage>, ) -> Self
Open (or create) memory storage at the given directory.
Sourcepub fn remember(
&self,
name: String,
description: String,
content: String,
) -> String
pub fn remember( &self, name: String, description: String, content: String, ) -> String
Create or update a memory entry.
Sourcepub fn write_index(&self, content: &str) -> String
pub fn write_index(&self, content: &str) -> String
Overwrite MEMORY.md (the curated overview).
Sourcepub fn build_prompt(&self) -> String
pub fn build_prompt(&self) -> String
Build system prompt block from MEMORY.md content.
Sourcepub fn before_run(&self, history: &[Message]) -> Vec<Message>
pub fn before_run(&self, history: &[Message]) -> Vec<Message>
Auto-recall from last user message, injected before each turn.
Auto Trait Implementations§
impl !Freeze for Memory
impl !RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnsafeUnpin for Memory
impl !UnwindSafe for Memory
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