feat(search): orchestrator-led agent swarm to search the vault + Mini App button

Add `npm run search` (mnemazine-kb-search.mjs): a recon → fan-out → fan-in
swarm over the live vault that writes a Russian "Справка" Markdown report.
Recon keyword-scores notes (0 tokens); --deep/MNEMAZINE_DEEP engages a
bounded-pool LLM swarm (one agent per shard, untrusted notes fenced), then
the orchestrator dedups + synthesizes. Local fallback keeps it 0-token by
default, mirroring the rest of the deep pipeline. Self-test included.

Wire it into the Telegram Mini App: the vault is Mac-only and the server is
on the VPS, so the button only enqueues. Server gains POST /api/search
(queue), GET /api/searches (list reports), GET /api/search?name= (read, with
path-escape guard). Mini App gets a search card + report list + text viewer
(rendered as text — no markdown XSS sink). The Mac poller drains the queue,
runs the swarm locally, and rsyncs reports back to the VPS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Зарубин Филипп
2026-06-19 18:28:37 +03:00
co-authored by Claude Opus 4.8
parent 3b7c85bae5
commit fbe205f3f1
5 changed files with 387 additions and 3 deletions
+3
View File
@@ -10,10 +10,13 @@
"graph:refresh": "node scripts/mnemazine-refresh-graphify.mjs --json",
"graph:shards": "node scripts/mnemazine-semantic-shards.mjs",
"graph:semantic-batches": "node scripts/mnemazine-semantic-batches.mjs",
"graph:semantic-swarm": "node scripts/mnemazine-semantic-swarm.mjs",
"graph:merge-semantic-shards": "node scripts/mnemazine-merge-semantic-shards.mjs",
"graph:clean": "python3 scripts/graphify_clean.py",
"graph:smoke": "node scripts/mnemazine-refresh-graphify-smoke.mjs",
"ingest:site": "node scripts/mnemazine-ingest-site.mjs",
"synthesize": "node scripts/mnemazine-synthesize.mjs",
"search": "node scripts/mnemazine-kb-search.mjs",
"weekly": "node scripts/mnemazine-weekly-brief-html.mjs",
"weekly:state": "node scripts/mnemazine-weekly-state.mjs",
"digest": "node scripts/mnemazine-digest.mjs",