pub struct MemoryPolicy {
pub memory_path: String,
pub stale_warning_days: u32,
pub retrieval_top_k: usize,
pub validation_enabled: bool,
pub max_content_bytes: Option<u32>,
pub max_name_length: Option<usize>,
}Expand description
Declarative configuration for the kernel’s long-term memory subsystem.
Installed via the set_memory_policy input event (opt-in). When no policy is installed the
kernel preserves pre-policy behavior: every write_memory is validated with the default rules
and query_memory uses the requested top_k verbatim. Installing a policy makes these knobs
authoritative:
validation_enabled = falseadmits every write without validation.retrieval_top_kis an upper bound: the emittedrequested_kismin(query.top_k, top_k).max_content_bytes/max_name_lengthoverride the validation size limits when set.
memory_path and stale_warning_days are not enforced inside the kernel (the kernel performs
no recall I/O); they are carried so the SDK consumes a single authoritative config.
Fields§
§memory_path: String§stale_warning_days: u32§retrieval_top_k: usize§validation_enabled: bool§max_content_bytes: Option<u32>§max_name_length: Option<usize>Implementations§
Source§impl MemoryPolicy
impl MemoryPolicy
Sourcepub fn validation(&self) -> MemoryValidation
pub fn validation(&self) -> MemoryValidation
Build the validation rules this policy implies, starting from the kernel defaults and applying any size / name-length overrides.
Sourcepub fn clamp_top_k(&self, requested: usize) -> usize
pub fn clamp_top_k(&self, requested: usize) -> usize
Clamp a requested retrieval count to this policy’s retrieval_top_k upper bound.
Trait Implementations§
Source§impl Clone for MemoryPolicy
impl Clone for MemoryPolicy
Source§fn clone(&self) -> MemoryPolicy
fn clone(&self) -> MemoryPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MemoryPolicy
impl Debug for MemoryPolicy
Auto Trait Implementations§
impl Freeze for MemoryPolicy
impl RefUnwindSafe for MemoryPolicy
impl Send for MemoryPolicy
impl Sync for MemoryPolicy
impl Unpin for MemoryPolicy
impl UnsafeUnpin for MemoryPolicy
impl UnwindSafe for MemoryPolicy
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