pub struct WriteInferenceConfig {
pub contradiction_threshold: f32,
pub obsolete_threshold: f32,
pub related_min: f32,
pub related_max: f32,
pub correction_threshold: f32,
pub confidence_decay_factor: f32,
pub confidence_floor: f32,
pub value_update_enabled: bool,
pub value_update_min_similarity: f32,
pub value_update_prefix_share: f32,
pub value_update_max_tail: usize,
}Expand description
Configuration for write-time inference thresholds.
Fields§
§contradiction_threshold: f32Similarity above which two memories may contradict (default: 0.95).
obsolete_threshold: f32Similarity above which an older memory is marked obsolete (default: 0.85).
Minimum similarity for creating a Related edge (default: 0.6).
Maximum similarity for creating a Related edge (default: 0.85).
correction_threshold: f32Minimum similarity for a Correction to supersede (default: 0.5).
confidence_decay_factor: f32Multiplier applied to original confidence on correction (default: 0.5).
confidence_floor: f32Minimum confidence after decay (default: 0.1).
value_update_enabled: boolWhether the value-update rule runs: a new memory that shares an older same-owner memory’s sentence frame (long common token prefix) but ends in a different value supersedes it, so “favorite coffee is a cortado” followed by “favorite coffee is a flat white” keeps only the correction. This is the cheap, LLM-free slice of contradiction handling; unlike bare cosine (which cannot tell paraphrase from contradiction and was removed at ~0% precision), the shared-frame test only fires on the update shape.
value_update_min_similarity: f32Minimum embedding similarity for the value-update rule (default: 0.3).
This is a loose topical floor, not the primary gate. A value correction
inherently drives cosine down (the changed value is most of a short
fact’s meaning), so real corrections land well below a high cosine bar:
measured on Titan V2 at 256 dims, “favorite coffee is a cortado” vs
“… a flat white” is 0.61 and “phone is 1234” vs “… 4321” is 0.51;
on OpenAI text-embedding-3-small they are 0.80 and 0.79. A 0.88 gate
(the first default) was unreachable on either embedder, and even 0.5
sat inside the real-pair range and silently gated identical-frame
pairs in production (observed on Cohere 1024: “uses Next.js for the
front end” vs “uses React for the front end” never superseded). The
embedder-independent is_value_update shared frame test carries the
precision here; the floor only rejects genuinely off-topic pairs that
a shared token frame collided on, which sit near 0.2 and below.
Minimum fraction of the longer memory’s tokens that must be shared frame, the common prefix plus the common suffix around the changed value (default: 0.6).
value_update_max_tail: usizeMaximum differing value tokens per side (default: 4). Larger middles mean genuinely different statements, not a value change.
Trait Implementations§
Source§impl Clone for WriteInferenceConfig
impl Clone for WriteInferenceConfig
Source§fn clone(&self) -> WriteInferenceConfig
fn clone(&self) -> WriteInferenceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more