feat(swarm): async LLM bridge + bounded-concurrency research swarm in deep synthesize
E3: llm bridge now uses async spawn (non-blocking) instead of spawnSync, so agent calls run concurrently. Deep synthesize processes clusters through a bounded pool (MNEMAZINE_CONCURRENCY, default 4) — cheap and fast. Each task is isolated (inner + outer try/catch): one cluster failing never blocks the swarm. Docs cover recognition fallback, swarm, concurrency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
b92328837e
commit
73cbc0d30c
@@ -36,8 +36,17 @@ All LLM calls go through one provider-abstracted module: `scripts/mnemazine-llm.
|
||||
| `MNEMAZINE_DEEP` | unset | `1` enables deep mode (enrich + atomize + verify + digest). |
|
||||
| `MNEMAZINE_ENRICH` | `1` within deep | `0` (or `--no-enrich`) skips the enrichment stage. |
|
||||
| `MNEMAZINE_MAX_ATOMS` | `20` | Cap on atoms produced per source cluster. |
|
||||
| `MNEMAZINE_CONCURRENCY` | `4` | Swarm size for deep research (parallel agents, bounded). |
|
||||
| `MNEMAZINE_OWNER_CONTEXT` | generic | Personal project context for the digest's "why it matters". Or put it in the gitignored `.mnemazine/owner-context.txt`. |
|
||||
|
||||
### Recognition (local-first, LLM fallback)
|
||||
|
||||
Extraction tries local engines first at **0 tokens**: Apple Vision OCR (images), markitdown (PDF/DOCX/PPTX/XLSX/HTML), whisper + frame OCR (video). Only when local yields nothing usable **and** `--deep` is on does a vision-capable LLM transcribe the file. Each file is isolated — one recognition failure logs an error, leaves the file in inbox, and never breaks the rest of the batch.
|
||||
|
||||
### Swarm
|
||||
|
||||
In deep mode, files/clusters are researched concurrently by a bounded pool of agents (`MNEMAZINE_CONCURRENCY`, default 4) — cheap and fast. A failing task never blocks the others.
|
||||
|
||||
### Enrichment (knowledge expansion)
|
||||
|
||||
Before atomization, deep mode runs a web-capable LLM agent that **researches and expands** the captured material "as much as is genuinely useful" — primary sources, current facts/versions, practitioner experience — with every added fact tied to a fetched URL (anti-hallucination). Atoms are then built from the **expanded** knowledge, not just the raw capture. Disable with `--no-enrich` / `MNEMAZINE_ENRICH=0`.
|
||||
|
||||
@@ -36,8 +36,17 @@ npm run synthesize -- --deep
|
||||
| `MNEMAZINE_DEEP` | не задано | `1` включает deep-режим (enrich + атомизация + проверка + digest). |
|
||||
| `MNEMAZINE_ENRICH` | `1` в deep | `0` (или `--no-enrich`) пропускает стадию обогащения. |
|
||||
| `MNEMAZINE_MAX_ATOMS` | `20` | Лимит атомов на один кластер источника. |
|
||||
| `MNEMAZINE_CONCURRENCY` | `4` | Размер роя для deep-исследования (параллельные агенты, ограниченно). |
|
||||
| `MNEMAZINE_OWNER_CONTEXT` | общий | Контекст личных проектов для блока «почему важно» в справке. Либо положите в gitignored `.mnemazine/owner-context.txt`. |
|
||||
|
||||
### Распознавание (локально сперва, LLM-fallback)
|
||||
|
||||
Извлечение сначала пробует локальные движки за **0 токенов**: Apple Vision OCR (картинки), markitdown (PDF/DOCX/PPTX/XLSX/HTML), whisper + OCR кадров (видео). Только если локально ничего пригодного **и** включён `--deep`, файл распознаёт vision-LLM. Каждый файл изолирован — ошибка распознавания логируется, файл остаётся в inbox, остальной батч не ломается.
|
||||
|
||||
### Рой
|
||||
|
||||
В deep-режиме файлы/кластеры исследуются параллельно ограниченным пулом агентов (`MNEMAZINE_CONCURRENCY`, по умолчанию 4) — дёшево и быстро. Упавшая задача не блокирует остальные.
|
||||
|
||||
### Обогащение (расширение знаний)
|
||||
|
||||
Перед атомизацией deep-режим запускает web-агента LLM, который **исследует и расширяет** захваченный материал «насколько реально полезно» — первоисточники, актуальные факты/версии, опыт практиков — каждый добавленный факт привязан к fetched-URL (антигаллюцинация). Атомы строятся из **расширенного** знания, не только из сырого захвата. Отключение: `--no-enrich` / `MNEMAZINE_ENRICH=0`.
|
||||
|
||||
Reference in New Issue
Block a user