Support API-backed Graphify semantic refresh

This commit is contained in:
Зарубин Филипп
2026-06-17 23:32:16 +03:00
parent 42c96d2b8c
commit d782c7faca
5 changed files with 114 additions and 20 deletions
+12
View File
@@ -40,6 +40,18 @@ Exit codes:
Defaults live in `config/graphify-refresh.json`.
API-backed semantic extraction:
```bash
OPENAI_API_KEY=... node scripts/mnemazine-refresh-graphify.mjs --backend openai --model gpt-4.1-mini --mode semantic --json
ANTHROPIC_API_KEY=... node scripts/mnemazine-refresh-graphify.mjs --backend claude --mode semantic --json
GEMINI_API_KEY=... node scripts/mnemazine-refresh-graphify.mjs --backend gemini --mode semantic --json
```
Do not commit API keys. The wrapper checks the required environment variable,
runs a mini `graphify extract` smoke test, backs up `graphify-out/`, and restores
the backup if semantic extraction fails or shrinks the graph unsafely.
Smoke test:
```bash
+12
View File
@@ -40,6 +40,18 @@ node scripts/mnemazine-refresh-graphify.mjs --vault "$MNEMAZINE_VAULT" --mode au
Дефолты лежат в `config/graphify-refresh.json`.
Семантическая экстракция через отдельный API:
```bash
OPENAI_API_KEY=... node scripts/mnemazine-refresh-graphify.mjs --backend openai --model gpt-4.1-mini --mode semantic --json
ANTHROPIC_API_KEY=... node scripts/mnemazine-refresh-graphify.mjs --backend claude --mode semantic --json
GEMINI_API_KEY=... node scripts/mnemazine-refresh-graphify.mjs --backend gemini --mode semantic --json
```
Ключи не коммитить. Wrapper проверяет нужную переменную окружения, запускает
мини-smoke `graphify extract`, делает бэкап `graphify-out/` и восстанавливает
его, если semantic extraction падает или небезопасно уменьшает граф.
Смоук-тест:
```bash