pub struct MemoryConfig {Show 18 fields
pub backend: String,
pub auto_save: bool,
pub hygiene_enabled: bool,
pub archive_after_days: u32,
pub purge_after_days: u32,
pub conversation_retention_days: u32,
pub min_relevance_score: f64,
pub response_cache_enabled: bool,
pub response_cache_ttl_minutes: u32,
pub response_cache_max_entries: usize,
pub response_cache_hot_entries: usize,
pub snapshot_enabled: bool,
pub snapshot_on_hygiene: bool,
pub auto_hydrate: bool,
pub default_namespace: String,
pub audit_enabled: bool,
pub audit_retention_days: u32,
pub policy: MemoryPolicyConfig,
}Expand description
Memory backend configuration ([memory] section).
Persistent memory in Construct is handled exclusively by Kumiho MCP; this section controls in-session auto-save behaviour and response caching.
Fields§
§backend: String"kumiho" (persistent via Kumiho MCP) or "none" (no-op, in-session only).
Legacy values (sqlite, lucid, markdown, qdrant) are rejected at
startup and should be migrated to kumiho.
auto_save: boolAuto-save user-stated conversation input to memory (assistant output is excluded)
hygiene_enabled: boolRun memory/session hygiene (archiving + retention cleanup)
archive_after_days: u32Archive daily/session files older than this many days
purge_after_days: u32Purge archived files older than this many days
conversation_retention_days: u32Prune archived conversation rows older than this many days.
min_relevance_score: f64Minimum hybrid score (0.0-1.0) for a memory to be included in context. Memories scoring below this threshold are dropped to prevent irrelevant context from bleeding into conversations. Default: 0.4
response_cache_enabled: boolEnable LLM response caching to avoid paying for duplicate prompts
response_cache_ttl_minutes: u32TTL in minutes for cached responses (default: 60)
response_cache_max_entries: usizeMax number of cached responses before LRU eviction (default: 5000)
response_cache_hot_entries: usizeMax in-memory hot cache entries for the two-tier response cache (default: 256)
snapshot_enabled: boolEnable periodic export of core memories to MEMORY_SNAPSHOT.md
snapshot_on_hygiene: boolRun snapshot during hygiene passes (heartbeat-driven)
auto_hydrate: boolAuto-hydrate from MEMORY_SNAPSHOT.md when brain.db is missing
default_namespace: StringDefault namespace for memory entries.
audit_enabled: boolEnable audit logging of memory operations.
audit_retention_days: u32Retention period for audit entries in days (default: 30).
policy: MemoryPolicyConfigMemory policy configuration.
Trait Implementations§
Source§impl Clone for MemoryConfig
impl Clone for MemoryConfig
Source§fn clone(&self) -> MemoryConfig
fn clone(&self) -> MemoryConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryConfig
impl Debug for MemoryConfig
Source§impl Default for MemoryConfig
impl Default for MemoryConfig
Source§impl<'de> Deserialize<'de> for MemoryConfig
impl<'de> Deserialize<'de> for MemoryConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for MemoryConfig
impl JsonSchema for MemoryConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. 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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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