pub struct MemoryConfig {
pub core_memory_bytes: usize,
pub working_memory_bytes: usize,
pub working_memory_ttl: Duration,
pub generate_embeddings: bool,
pub embedding_batch_size: usize,
pub default_recall_limit: usize,
pub semantic_search_enabled: bool,
pub query_expansion_enabled: bool,
}Expand description
Global configuration for Memory system.
TigerStyle:
- Sensible defaults via Default impl
- Builder pattern for customization
- All fields public for transparency
§Example
use umi_memory::umi::MemoryConfig;
let config = MemoryConfig::default()
.with_recall_limit(20)
.without_embeddings();Fields§
§core_memory_bytes: usizeCore memory size in bytes (always in LLM context).
Default: 32KB
working_memory_bytes: usizeWorking memory size in bytes (session state with TTL).
Default: 1MB
working_memory_ttl: DurationWorking memory time-to-live duration.
Default: 1 hour
generate_embeddings: boolWhether to generate embeddings for entities.
Default: true
embedding_batch_size: usizeEmbedding batch size for bulk operations.
Default: 100
default_recall_limit: usizeDefault recall result limit.
Default: 10
semantic_search_enabled: boolWhether to enable semantic (vector) search.
Default: true
query_expansion_enabled: boolWhether to enable LLM query expansion for retrieval.
Default: true (auto-enabled when beneficial)
Implementations§
Source§impl MemoryConfig
impl MemoryConfig
Sourcepub fn with_core_memory_bytes(self, bytes: usize) -> Self
pub fn with_core_memory_bytes(self, bytes: usize) -> Self
Sourcepub fn with_working_memory_bytes(self, bytes: usize) -> Self
pub fn with_working_memory_bytes(self, bytes: usize) -> Self
Sourcepub fn with_working_memory_ttl(self, ttl: Duration) -> Self
pub fn with_working_memory_ttl(self, ttl: Duration) -> Self
Sourcepub fn with_recall_limit(self, limit: usize) -> Self
pub fn with_recall_limit(self, limit: usize) -> Self
Sourcepub fn with_embedding_batch_size(self, size: usize) -> Self
pub fn with_embedding_batch_size(self, size: usize) -> Self
Sourcepub fn without_embeddings(self) -> Self
pub fn without_embeddings(self) -> Self
Disable embedding generation.
Sourcepub fn without_semantic_search(self) -> Self
pub fn without_semantic_search(self) -> Self
Disable semantic (vector) search.
Sourcepub fn without_query_expansion(self) -> Self
pub fn without_query_expansion(self) -> Self
Disable query expansion.
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 moreSource§impl Debug for MemoryConfig
impl Debug for MemoryConfig
Auto 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