zettelkasten.synapse.eval¶
zettelkasten.synapse.eval ¶
CLI-first eval harness for synapse.
Two objective checks that replace a human approval gate with measurable signal:
-
Connection impact on retrieval — for a set of questions, compare cross-store search WITHOUT vs WITH overlay expansion. Reports what the typed connections actually add (how many extra nodes surface, from which store, via which relation). If expansion adds nothing, the connections aren't earning their keep.
-
Typed-edge precision spot-check — sample edges from the overlay for review, with the relation, confidence, rationale, and (optionally) resolved titles, plus the relation/confidence distribution. This is the objective substitute for eyeballing every edge.
Run it::
python -m zettelkasten.synapse.eval --sample 20
python -m zettelkasten.synapse.eval --questions-file q.txt --projects factors,execution
Everything is read-only. The retrieval-impact functions accept an injected
search_fn so the harness (and its tests) run without the MCP server / an LLM.
retrieval_impact ¶
retrieval_impact(questions: list[str], zk_get_graph: GetGraph, projects: list[str] | None = None, top_k: int = 15, expand_min_conf: float = 0.6, search_fn: Callable[..., dict[str, Any]] | None = None) -> dict[str, Any]
Compare cross-store search without vs with overlay expansion, per question.
Source code in zettelkasten/synapse/eval.py
edge_precision_sample ¶
edge_precision_sample(overlay: dict[str, Any] | None = None, sample_size: int = 20, seed: int = 0, zk_get_graph: GetGraph | None = None, projects: list[str] | None = None) -> dict[str, Any]
Sample overlay edges for a precision spot-check + report distributions.