zettelkasten.config¶
zettelkasten.config ¶
Lightweight config store for the Zettelkasten.
Config lives at .zettelkasten/config.yaml — committed alongside the notes,
mirroring how the memory subsystem keeps .memory/config.yaml. It is read by
zettelkasten.federation to discover related repos to project read-only.
The path is resolved against zettelkasten.graph.GRAPHS_DIR at call time (not
import time) so tests that repoint graph.GRAPHS_DIR see the change.
config_path ¶
read_config ¶
Read the config, returning {} when missing or malformed.
Source code in zettelkasten/config.py
write_config ¶
Write the config atomically (temp file + rename).
Source code in zettelkasten/config.py
rerank_config ¶
Build a populated :class:zettelkasten.reranking.RerankConfig.
Starts from :func:zettelkasten.reranking.default_config (the canonical
defaults live there) and applies .zettelkasten/config.yaml rerank:
values, then ANGELO_ZK_RERANK_* env overrides (env wins). A missing/
malformed config or unparseable value falls back to the default for that
field, so retrieval never crashes on bad config.
Note: session_half_life is a usage-recency knob (consumed by
:func:zettelkasten.usage.recency_scores, not a RerankConfig field) — read
it via :func:session_half_life.
Source code in zettelkasten/config.py
session_half_life ¶
Recency half-life in SESSIONS for :func:zettelkasten.usage.recency_scores.
Resolved like the reranker weights (rerank.session_half_life YAML key,
ANGELO_ZK_RERANK_SESSION_HALF_LIFE env override), defaulting to
:data:zettelkasten.usage.DEFAULT_HALF_LIFE_SESSIONS.
Source code in zettelkasten/config.py
use_global_index ¶
Whether project-scoped search routes through the global ANN index.
Resolved as env ANGELO_ZK_USE_GLOBAL_INDEX > top-level
use_global_index YAML key > True (default on). When off, callers use
the legacy per-box fan-out. The global index also transparently falls back to
per-box when it is cold/empty or disabled (see server._semantic_recall).
Source code in zettelkasten/config.py
rerank_disabled ¶
Whether a config reproduces today's pure-similarity ranking exactly.
Reranking degenerates to similarity-only ordering when BOTH boost channels
are off (w_importance == w_recency == 0). In that case there is nothing
to blend and, per the "no silent diversification" contract, MMR is treated as
off too — REGARDLESS of mmr_lambda. This is deliberate: mmr_lambda
defaults to 0.7, so keying disablement on mmr_lambda >= 1.0 would leave a
user who zeroed only the weights getting silent MMR diversification they
never asked for. (An MMR-only mode — diversify without importance/recency —
would need its own explicit flag, not this weights-off path.) Callers use
this to SKIP the rerank stage entirely in that case, so a "reranking off"
config reproduces each surface's legacy ordering byte-for-byte (e.g. framing's
fused-rank order, which pure cosine reranking would not reproduce).