Skip to main content

MemCotConfig

Struct MemCotConfig 

Source
pub struct MemCotConfig {
    pub enabled: bool,
    pub distill_provider: ProviderName,
    pub distill_timeout_secs: u64,
    pub min_assistant_chars: usize,
    pub min_distill_interval_secs: u64,
    pub max_distills_per_session: u64,
    pub max_state_chars: usize,
    pub recall_view: RecallViewConfig,
    pub zoom_out_neighbor_cap: usize,
    pub fast_tier_models: Vec<String>,
}
Expand description

MemCoT semantic-state distillation configuration.

When enabled = true, the agent maintains a short rolling “semantic state” buffer summarizing conceptual progress across turns. This buffer is injected into graph recall queries to improve retrieval relevance.

All LLM work (distillation) runs asynchronously — never on the turn thread. When enabled = false, this is a complete no-op: no allocation, no LLM calls.

§Config example

[memory.memcot]
enabled = true
distill_provider = "fast"
distill_timeout_secs = 5
min_assistant_chars = 200
min_distill_interval_secs = 30
max_distills_per_session = 50
max_state_chars = 800
recall_view = "head"

Fields§

§enabled: bool

Enable the MemCoT semantic state pipeline. Default: false.

When false, the accumulator is never allocated and no LLM calls are made.

§distill_provider: ProviderName

Provider name from [[llm.providers]] for distillation.

Must reference a fast-tier provider (e.g. gpt-4o-mini, qwen3:8b). A startup warning is emitted when the resolved model does not look fast-tier. Falls back to the primary provider when empty. Default: "".

§distill_timeout_secs: u64

Timeout in seconds for each distillation LLM call. Default: 5.

§min_assistant_chars: usize

Minimum characters in the assistant response to trigger distillation. Short or trivial replies are skipped. Default: 200.

§min_distill_interval_secs: u64

Minimum elapsed seconds between successive distillation spawns. Default: 30.

Prevents runaway costs on long sessions with rapid turns. Clearing /new resets this counter.

§max_distills_per_session: u64

Maximum distillation spawns per conversation session. Default: 50.

Once this cap is reached the accumulator stops distilling for the rest of the session. Counter is reset when the user sends /new.

§max_state_chars: usize

Maximum characters for the semantic state buffer (UTF-8 char boundary truncation). Default: 800.

§recall_view: RecallViewConfig

Recall view applied when MemCoT is active. Default: Head.

  • head: standard retrieval, no enrichment (suitable for low-latency setups).
  • zoom_in: adds source-message provenance to each returned fact.
  • zoom_out: expands 1-hop neighbors per returned fact.

TODO(F3): add a per-call override parameter on recall_graph_view.

§zoom_out_neighbor_cap: usize

Maximum 1-hop neighbor facts per head fact in zoom_out view. Default: 3.

§fast_tier_models: Vec<String>

Optional model name allowlist for the fast-tier soft validator (lowercase substring match). Empty (default) → falls back to the built-in FAST_TIER_MODEL_HINTS list.

Trait Implementations§

Source§

impl Clone for MemCotConfig

Source§

fn clone(&self) -> MemCotConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MemCotConfig

Source§

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

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

impl Default for MemCotConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for MemCotConfig

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 MemCotConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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>,