pub struct MemoryConfig {
pub backend: Arc<dyn Memory>,
pub agent_id: String,
pub session_id: Option<String>,
pub persist_conversations: bool,
pub enable_semantic: bool,
pub enable_episodic: bool,
pub enable_working: bool,
pub max_conversation_length: usize,
pub auto_generate_session_id: bool,
}Expand description
Configuration for agent memory system
Fields§
§backend: Arc<dyn Memory>Storage backend (InMemoryStorage, DatabaseStorage, etc.)
agent_id: StringUnique agent identifier (for agent-scoped memory)
session_id: Option<String>Optional session identifier (for session-scoped memory)
persist_conversations: boolWhether to persist conversation history to storage
enable_semantic: boolEnable semantic memory (facts/knowledge storage)
enable_episodic: boolEnable episodic memory (summarized history)
enable_working: boolEnable working memory (temporary scratchpad)
max_conversation_length: usizeMaximum conversation length before pruning
auto_generate_session_id: boolAuto-generate session IDs if not provided
Implementations§
Source§impl MemoryConfig
impl MemoryConfig
Sourcepub fn new(backend: Arc<dyn Memory>, agent_id: impl Into<String>) -> Self
pub fn new(backend: Arc<dyn Memory>, agent_id: impl Into<String>) -> Self
Create a new memory configuration
Sourcepub fn with_session_id(self, session_id: impl Into<String>) -> Self
pub fn with_session_id(self, session_id: impl Into<String>) -> Self
Set session ID
Sourcepub fn with_persistence(self, persist: bool) -> Self
pub fn with_persistence(self, persist: bool) -> Self
Enable conversation persistence
Sourcepub fn with_semantic_memory(self, enable: bool) -> Self
pub fn with_semantic_memory(self, enable: bool) -> Self
Enable semantic memory
Sourcepub fn with_episodic_memory(self, enable: bool) -> Self
pub fn with_episodic_memory(self, enable: bool) -> Self
Enable episodic memory
Sourcepub fn with_working_memory(self, enable: bool) -> Self
pub fn with_working_memory(self, enable: bool) -> Self
Enable working memory
Sourcepub fn with_max_conversation_length(self, length: usize) -> Self
pub fn with_max_conversation_length(self, length: usize) -> Self
Set max conversation length
Sourcepub fn with_auto_session_id(self, auto: bool) -> Self
pub fn with_auto_session_id(self, auto: bool) -> Self
Enable/disable auto session ID generation
Trait Implementations§
Source§impl Clone for MemoryConfig
impl Clone for MemoryConfig
Source§fn clone(&self) -> MemoryConfig
fn clone(&self) -> MemoryConfig
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 moreAuto Trait Implementations§
impl Freeze for MemoryConfig
impl !RefUnwindSafe for MemoryConfig
impl Send for MemoryConfig
impl Sync for MemoryConfig
impl Unpin for MemoryConfig
impl !UnwindSafe for MemoryConfig
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