pub struct MemoryConfig {Show 27 fields
pub enabled: bool,
pub auto_inject: bool,
pub auto_retain: bool,
pub retain_llm: bool,
pub retain_llm_always: bool,
pub retain_every_n: usize,
pub retain_max_facts: usize,
pub max_index_lines: usize,
pub max_index_bytes: usize,
pub recall_top_k: usize,
pub recall_min_score: f32,
pub recall_token_budget: usize,
pub embed_dim: usize,
pub scope: String,
pub embed_backend: String,
pub code_inject: bool,
pub code_top_k: usize,
pub code_min_score: f32,
pub subagent_banks: bool,
pub auto_index: bool,
pub auto_index_max_files: usize,
pub auto_index_max_chunks: usize,
pub session_inject: bool,
pub session_top_k: usize,
pub session_min_score: f32,
pub consolidate: bool,
pub consolidate_max: usize,
}Expand description
Cross-session semantic / auto memory (Claude-style index + local recall).
Fields§
§enabled: boolMaster switch. Default on (cheap hashing embedder; no ONNX).
auto_inject: boolAuto-inject top-k semantic hits for the current user message.
auto_retain: boolPost-turn auto-retain (heuristic and/or LLM). Default on.
retain_llm: boolAlso call a small LLM to extract durable facts when heuristic finds none
(or always when retain_llm_always). Default on.
retain_llm_always: boolRun LLM retain even if heuristic already found facts.
retain_every_n: usizeRun retain every N user turns (1 = every turn).
retain_max_facts: usizeMax facts retained per turn.
max_index_lines: usizeMax lines of MEMORY.md loaded into every session (Claude parity: 200).
max_index_bytes: usizeMax bytes of MEMORY.md loaded into every session (Claude parity: 25 KiB).
recall_top_k: usizeMax recalled facts injected per turn.
recall_min_score: f32Minimum cosine similarity for a fact to be recalled.
recall_token_budget: usizeToken budget for recalled facts (chars ≈ tokens × 4).
embed_dim: usizeHashing embedder dimension (stored BLOB width).
scope: Stringuser (data_dir, default) or project (.whycodes/memory, git-shareable).
embed_backend: Stringhash (default) or onnx (MiniLM; needs --features onnx).
code_inject: boolInject code-index hits when available.
code_top_k: usize§code_min_score: f32§subagent_banks: boolGive subagents their own memory bank (project::agent_name).
auto_index: boolOn session start, ensure a code index exists (skip if already indexed).
auto_index_max_files: usizeMax source files to walk when auto-indexing.
auto_index_max_chunks: usizeMax chunks when auto-indexing.
session_inject: boolInject related past-session turns.
session_top_k: usize§session_min_score: f32§consolidate: boolCap the fact bank after retain.
consolidate_max: usizeTrait Implementations§
Source§impl Clone for MemoryConfig
impl Clone for MemoryConfig
Source§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>,
Auto 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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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