Skip to content

zettelkasten.synapse.build

zettelkasten.synapse.build

Out-of-process synapse overlay build (subprocess / CLI entrypoint).

The synapse build action types cross-store candidate pairs with an LLM via the in-process cursor-sdk agent bridge. That bridge does NOT come up inside the stdio MCP server, whose stdin/stdout ARE the JSON-RPC transport — the bridge launches but its completion never returns, hanging (and formerly crashing) the server. So the MCP synapse(action="build") tool runs THIS module as a fresh subprocess instead: a clean host with ordinary stdio, where the bridge launches exactly as it does for the dashboard/CLI. The subprocess writes the overlay to .synapse/links/ (via :func:overlay.build_connections) and prints a single machine-readable result line the parent parses.

Usage::

python -m zettelkasten.synapse.build \
    --projects-json '["a","b"]' \
    [--per-node-k N] [--sim-threshold F] [--min-confidence F] [--max-pairs N]

--projects-json is a JSON value: null = use the configured intersection, [] = memory only, ["a","b"] = an explicit scope. On completion the module prints one line SYNAPSE_BUILD_RESULT <json> to stdout, where <json> is {"manifest": {...}, "edge_count": N} on success or additionally carries "error" when the typing backend was unavailable. All logging goes to stderr, so the parent can parse stdout unambiguously.