pub struct ProjectConfig {Show 13 fields
pub kimetsu: KimetsuSection,
pub model: ModelSection,
pub broker: BrokerSection,
pub shell: ShellSection,
pub ingestion: IngestionSection,
pub run: RunSection,
pub embedder: EmbedderSection,
pub learning: LearningSection,
pub cheap_model: Option<CheapModelSection>,
pub storage: StorageSection,
pub sync: SyncSection,
pub lifecycle: LifecycleSection,
pub retrieval: RetrievalSection,
}Fields§
§kimetsu: KimetsuSection§model: ModelSection§broker: BrokerSection§shell: ShellSection§ingestion: IngestionSection§run: RunSection§embedder: EmbedderSectionv0.8: which built-in embedding model the brain uses. The
#[serde(default)] keeps every pre-v0.8 project.toml loading
cleanly (they get the lean English default). Resolution
precedence is KIMETSU_BRAIN_EMBEDDER env > this field >
default; see kimetsu_brain::embeddings::resolve_embedder_id.
learning: LearningSectionv0.8.5: automatic memory harvesting. #[serde(default)] keeps
pre-v0.8.5 project.toml files loading cleanly (they get
auto-harvest on).
cheap_model: Option<CheapModelSection>S1.2: top-level cheap-model override. When present, takes
precedence over [learning.distiller] as the resolved cheap
model for all consumers (distiller, consolidation, future
digest/ask). Entirely optional — when absent the resolver falls
back to [learning.distiller] for back-compat. #[serde(default)]
keeps all existing project.toml files loading unchanged.
storage: StorageSectionS5.1: storage / retrieval backend selection. #[serde(default)]
keeps every existing project.toml loading cleanly (they get
backend = "flat", the current FTS + usearch-ANN path).
sync: SyncSectionEpic S3: personal brain sync via event-log replication.
#[serde(default)] keeps every pre-S3 project.toml loading cleanly
(they get no sync dir and a freshly-generated machine_id).
lifecycle: LifecycleSectionF3 Flagship 3 / Lifecycle & forgetting policy.
#[serde(default)] keeps all existing project.toml files loading
cleanly (they get forgetting disabled, sane defaults for all thresholds,
regret threshold 5, proposal expiry 30d, auto-accept disabled).
retrieval: RetrievalSectionRetrieval pipeline preset. A single knob that bundles the retrieval
stack (embedder.enabled + embedder.reranker + HyDE) so users pick one
level instead of tuning each piece by hand. #[serde(default)]
keeps every existing project.toml loading cleanly: absent ⇒
level = "custom", which is a no-op and leaves [embedder] exactly
as configured (byte-identical behaviour to before this field existed).
Resolved into [embedder] at config-load time by
ProjectConfig::apply_retrieval_level.
Implementations§
Source§impl ProjectConfig
impl ProjectConfig
pub fn default_for_project(project_id: impl Into<String>) -> Self
Sourcepub fn apply_retrieval_level(&mut self)
pub fn apply_retrieval_level(&mut self)
Apply the retrieval-level preset, mutating embedder.enabled +
embedder.reranker to match the configured [retrieval] level.
Resolution:
basic⇒ embedder off, reranker off (FTS lexical only).flexible⇒ embedder on, reranker off (semantic, no rerank).deep⇒ embedder on, rerankerms-marco-tinybert-l-2-v2.advanced⇒ same asdeep, plus HyDE (seeSelf::hyde_from_level).custom/unknown ⇒ no-op: use the configured[embedder]values as-is (the escape hatch for manual tuning).
Called once at the load chokepoint (load_config) so every retrieval
consumer sees the resolved [embedder] values automatically.
Sourcepub fn hyde_from_level(&self) -> bool
pub fn hyde_from_level(&self) -> bool
True when the configured level enables HyDE query expansion.
Sourcepub fn cheap_model(&self) -> Option<CheapModelSection>
pub fn cheap_model(&self) -> Option<CheapModelSection>
S1.2: resolve the effective cheap-model config.
Resolution order (first wins):
[cheap_model]if present ANDenabled = true— explicit top-level section introduced in S1.2.[learning.distiller]ifenabled = true— back-compat alias so any existing config with[learning.distiller]keeps working with zero changes.None— no cheap model configured; consumers degrade gracefully (no panic, feature just does not run — same as distiller-absent behaviour before S1.2).
FUTURE consumers (digest/resume/skill/ask) must call this resolver so resolution stays in ONE place.
Sourcepub fn tier(&self) -> Tier
pub fn tier(&self) -> Tier
v2.6: resolve the effective product tier.
Resolution order (first wins):
KIMETSU_TIERenv var (free/deep; an unparseable value is ignored rather than fatal — a typo in a shell profile must not break retrieval).[kimetsu] tier, when set explicitly.- Auto: Deep when a cheap model is configured, Free otherwise.
deep downgrades to free when Self::cheap_model resolves to
None. Deep with no reachable model is not a third state: it is Free
with a misleading label, and every consumer would have to re-check.
Resolving it here means a caller can branch on the tier alone; use
Self::tier_downgraded when you want to report the discrepancy.
Sourcepub fn tier_requested(&self) -> Option<Tier>
pub fn tier_requested(&self) -> Option<Tier>
The tier the user explicitly asked for, if any. None means auto.
Sourcepub fn tier_downgraded(&self) -> bool
pub fn tier_downgraded(&self) -> bool
True when Deep was asked for but no cheap model is reachable, so the
brain is silently running Free. kimetsu doctor surfaces this: the
failure mode it guards against is paying attention to a deep label
while none of the Deep features can actually run.
Sourcepub fn allows_model_in_pipeline(&self) -> bool
pub fn allows_model_in_pipeline(&self) -> bool
The single gate every Deep-only code path must consult before making a model call in the memory pipeline.
Equivalent to self.tier().allows_model(), named for the invariant it
enforces: on Free this returns false, and the “zero LLM calls” claim is
exactly the statement that no memory-pipeline call site proceeds past it.
Sourcepub fn allows_automatic_harvest(&self) -> bool
pub fn allows_automatic_harvest(&self) -> bool
Automatic harvesting may ask either a configured model or the host to generate lessons. Both obey the same Free/Deep policy; a missing model is Free, never an implicit host-generation fallback.
pub fn from_toml(value: &str) -> KimetsuResult<Self>
pub fn to_toml(&self) -> KimetsuResult<String>
Trait Implementations§
Source§impl Clone for ProjectConfig
impl Clone for ProjectConfig
Source§fn clone(&self) -> ProjectConfig
fn clone(&self) -> ProjectConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more