Skip to main content

MemoryConfig

Struct MemoryConfig 

Source
pub struct MemoryConfig {
Show 48 fields pub compression_guidelines: CompressionGuidelinesConfig, pub sqlite_path: String, pub history_limit: u32, pub qdrant_url: String, pub semantic: SemanticConfig, pub summarization_threshold: usize, pub context_budget_tokens: usize, pub soft_compaction_threshold: f32, pub hard_compaction_threshold: f32, pub compaction_preserve_tail: usize, pub compaction_cooldown_turns: u8, pub auto_budget: bool, pub prune_protect_tokens: usize, pub cross_session_score_threshold: f32, pub vector_backend: VectorBackend, pub token_safety_margin: f32, pub redact_credentials: bool, pub autosave_assistant: bool, pub autosave_min_length: usize, pub tool_call_cutoff: usize, pub sqlite_pool_size: u32, pub sessions: SessionsConfig, pub documents: DocumentConfig, pub eviction: EvictionConfig, pub compression: CompressionConfig, pub sidequest: SidequestConfig, pub graph: GraphConfig, pub shutdown_summary: bool, pub shutdown_summary_min_messages: usize, pub shutdown_summary_max_messages: usize, pub shutdown_summary_timeout_secs: u64, pub structured_summaries: bool, pub tiers: TierConfig, pub admission: AdmissionConfig, pub digest: DigestConfig, pub context_strategy: ContextStrategy, pub crossover_turn_threshold: u32, pub consolidation: ConsolidationConfig, pub forgetting: ForgettingConfig, pub database_url: Option<String>, pub store_routing: StoreRoutingConfig, pub persona: PersonaConfig, pub trajectory: TrajectoryConfig, pub category: CategoryConfig, pub tree: TreeConfig, pub microcompact: MicrocompactConfig, pub autodream: AutoDreamConfig, pub key_facts_dedup_threshold: f32,
}

Fields§

§compression_guidelines: CompressionGuidelinesConfig§sqlite_path: String§history_limit: u32§qdrant_url: String§semantic: SemanticConfig§summarization_threshold: usize§context_budget_tokens: usize§soft_compaction_threshold: f32§hard_compaction_threshold: f32§compaction_preserve_tail: usize§compaction_cooldown_turns: u8§auto_budget: bool§prune_protect_tokens: usize§cross_session_score_threshold: f32§vector_backend: VectorBackend§token_safety_margin: f32§redact_credentials: bool§autosave_assistant: bool§autosave_min_length: usize§tool_call_cutoff: usize§sqlite_pool_size: u32§sessions: SessionsConfig§documents: DocumentConfig§eviction: EvictionConfig§compression: CompressionConfig§sidequest: SidequestConfig§graph: GraphConfig§shutdown_summary: bool

Store a lightweight session summary to the vector store on shutdown when no session summary exists yet for this conversation. Enables cross-session recall for short or interrupted sessions that never triggered hard compaction. Default: true.

§shutdown_summary_min_messages: usize

Minimum number of user-turn messages required before a shutdown summary is generated. Sessions below this threshold are considered trivial and skipped. Default: 4.

§shutdown_summary_max_messages: usize

Maximum number of recent messages (user + assistant) sent to the LLM for shutdown summarization. Caps token cost for long sessions that never triggered hard compaction. Default: 20.

§shutdown_summary_timeout_secs: u64

Per-attempt timeout in seconds for each LLM call during shutdown summarization. Applies independently to the structured call and to the plain-text fallback. Default: 10.

§structured_summaries: bool

Use structured anchored summaries for context compaction.

When enabled, hard compaction requests a JSON schema from the LLM instead of free-form prose. Falls back to prose if the LLM fails to produce valid JSON. Default: false.

§tiers: TierConfig

AOI three-layer memory tier promotion system.

When tiers.enabled = true, a background sweep promotes frequently-accessed episodic messages to a semantic tier by clustering near-duplicates and distilling via LLM.

§admission: AdmissionConfig

A-MAC adaptive memory admission control.

When admission.enabled = true, each message is evaluated before saving and rejected if its composite admission score falls below the configured threshold.

§digest: DigestConfig

Session digest generation at session end. Default: disabled.

§context_strategy: ContextStrategy

Context assembly strategy. Default: full_history (current behavior).

§crossover_turn_threshold: u32

Number of turns at which Adaptive strategy switches to MemoryFirst. Default: 20.

§consolidation: ConsolidationConfig

All-Mem lifelong memory consolidation sweep.

When consolidation.enabled = true, a background loop clusters semantically similar messages and merges them into consolidated entries via LLM.

§forgetting: ForgettingConfig

SleepGate forgetting sweep (#2397).

When forgetting.enabled = true, a background loop periodically decays importance scores and prunes memories below the forgetting floor.

§database_url: Option<String>

PostgreSQL connection URL.

Used when the binary is compiled with --features postgres. Can be overridden by the vault key ZEPH_DATABASE_URL. Example: postgres://user:pass@localhost:5432/zeph Default: None (uses sqlite_path instead).

§store_routing: StoreRoutingConfig

Cost-sensitive store routing (#2444).

When store_routing.enabled = true, query intent is classified and routed to the cheapest sufficient backend instead of querying all stores on every turn.

§persona: PersonaConfig

Persona memory layer (#2461).

When persona.enabled = true, user preferences and domain knowledge are extracted from conversation history and injected into context after the system prompt.

§trajectory: TrajectoryConfig

Trajectory-informed memory (#2498).

§category: CategoryConfig

Category-aware memory (#2428).

§tree: TreeConfig

TiMem temporal-hierarchical memory tree (#2262).

§microcompact: MicrocompactConfig

Time-based microcompact (#2699).

When microcompact.enabled = true, stale low-value tool outputs are cleared from context when the session has been idle longer than gap_threshold_minutes.

§autodream: AutoDreamConfig

autoDream background memory consolidation (#2697).

When autodream.enabled = true, a constrained consolidation subagent runs after a session ends if both min_sessions and min_hours gates pass.

§key_facts_dedup_threshold: f32

Cosine similarity threshold for deduplicating key facts in zeph_key_facts (#2717).

Before inserting a new key fact, its nearest neighbour is looked up in the zeph_key_facts collection. If the best score is ≥ this threshold the fact is considered a near-duplicate and skipped. Set to a value greater than 1.0 (e.g. 2.0) to disable dedup entirely. Default: 0.95.

Trait Implementations§

Source§

impl Debug for MemoryConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MemoryConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MemoryConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,