pub struct DefaultMemoryStrategy { /* private fields */ }Expand description
Default memory strategy that delegates to existing implementations.
Phase 1: This is a thin wrapper. It does not duplicate logic;
it calls DefaultMemoryLoader, consolidation::consolidate_turn,
and hygiene::run_if_due directly, preserving current behavior
byte-for-byte.
Implementations§
Source§impl DefaultMemoryStrategy
impl DefaultMemoryStrategy
pub fn new( memory: Arc<dyn Memory>, memory_config: MemoryConfig, workspace_dir: impl Into<PathBuf>, ) -> DefaultMemoryStrategy
Sourcepub fn with_config(
memory: Arc<dyn Memory>,
memory_config: MemoryConfig,
workspace_dir: impl Into<PathBuf>,
) -> DefaultMemoryStrategy
pub fn with_config( memory: Arc<dyn Memory>, memory_config: MemoryConfig, workspace_dir: impl Into<PathBuf>, ) -> DefaultMemoryStrategy
Convenience constructor that takes the live MemoryConfig so
run_governance uses the operator’s actual settings (archive
windows, hygiene toggle, etc.) rather than hardcoded defaults.
Trait Implementations§
Source§impl MemoryStrategy for DefaultMemoryStrategy
impl MemoryStrategy for DefaultMemoryStrategy
Source§fn load_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
session_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
DefaultMemoryStrategy: 'async_trait,
fn load_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
session_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
DefaultMemoryStrategy: 'async_trait,
Load and format relevant memory context for a conversation turn.
Source§fn consolidate_turn<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
user_message: &'life1 str,
assistant_response: &'life2 str,
provider: &'life3 dyn ModelProvider,
model: &'life4 str,
temperature: Option<f64>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
DefaultMemoryStrategy: 'async_trait,
fn consolidate_turn<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
user_message: &'life1 str,
assistant_response: &'life2 str,
provider: &'life3 dyn ModelProvider,
model: &'life4 str,
temperature: Option<f64>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
DefaultMemoryStrategy: 'async_trait,
Consolidate a conversation turn into long-term memory.
Auto Trait Implementations§
impl Freeze for DefaultMemoryStrategy
impl !RefUnwindSafe for DefaultMemoryStrategy
impl Send for DefaultMemoryStrategy
impl Sync for DefaultMemoryStrategy
impl Unpin for DefaultMemoryStrategy
impl UnsafeUnpin for DefaultMemoryStrategy
impl !UnwindSafe for DefaultMemoryStrategy
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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