4.3 KiB
4.3 KiB
Handoff — graphify-ollama-setup (2026-06-05)
Where we are
Mid-application of the graphify-ollama-setup OpenSpec change. Toolchain installed; the hard part (finding a local model that produces relationship-bearing graphs through graphify) is SOLVED. Remaining: formal scoring, selection record, vault build, doc updates, verify.
The working config (use this)
- Model: qwen2.5-coder:7b (graphify's shipped default). Run via Modelfile variant
qwen25-coder-7b-16k(already created:FROM qwen2.5-coder:7b+PARAMETER num_ctx 16384). - Always:
OLLAMA_BASE_URL=http://127.0.0.1:11434/v1(MUST end in/v1),--backend ollama --max-concurrency 1(single 12GB GPU, run models sequentially). - A one-line thinking-OFF patch (
reasoning_effort:"none") is applied to installed~/.local/lib/python3.14/site-packages/graphify/llm.py(backup: /tmp/graphify-bench/llm.py.orig; patched copy: /tmp/graphify-bench/llm.py.patched). No-op for qwen2.5-coder but harmless; note it for production (lost onpip install --upgrade).
Gotchas (all the lessons, so you don't relearn them)
GRAPHIFY_OLLAMA_NUM_CTXenv var does NOT propagate through graphify's ollama/v1endpoint — bakenum_ctxinto a Modelfile variant instead. Verify withollama ps(CONTEXT column).graphify extract <path>needs a DIRECTORY, not a single file. Each benchmark fixture was isolated in its own dir.- For the vault build, add
--exclude .obsidian(graphify treats.obsidian/*.jsonas code and indexes it as noise). extractproducesgraphify-out/graph.json+.graphify_analysis.json(god-nodes here). It does NOT produceGRAPH_REPORT.md— that's a separate step; read the analysis JSON for the god-node sanity check (task 4.2).- OLLAMA_API_KEY only needed if base_url is non-loopback; 127.0.0.1 avoids it.
- Small models (gemma4:e4b 8B, gemma4:e2b 5.1B, qwen3.5:2b 2.3B) all FAIL the relationship/edge gate through graphify's prompt — don't revisit them.
Remaining tasks (in order)
- 3.4 — Score qwen2.5-coder:7b outputs vs the
.opusreferences (docs/memory-system/benchmark/reference-outputs/*.opus.md) on the 3 COMPARABLE dimensions only: entity correctness, relationship plausibility, edge-level EXTRACTED/INFERRED/AMBIGUOUS confidence. EXCLUDE facets + entity-type + free-text relation-typing (graphify doesn't emit them; facets are note metadata per ADR-011). The qwen2.5-coder per-fixture node/edge lists are recorded verbatim indocs/memory-system/benchmark/scoring-results-2026-06-04.md(Round 3) so you can score WITHOUT re-running. Raw graph.json (if /tmp survived):/tmp/graphify-bench/out6/coder7b/<slug>/graphify-out/graph.json. - 3.5 / 3.6 — Record + select: add scoring scores + selection rationale to the findings doc; qwen2.5-coder:7b is the de-facto selection. Per the change, don't lock before 3.4 is done.
- 4 — Build vault graph:
OLLAMA_BASE_URL=http://127.0.0.1:11434/v1 graphify extract ~/Documents/SecondBrain --backend ollama --model qwen25-coder-7b-16k --max-concurrency 2 --token-budget 4000 --exclude .obsidian --out <dir>. (token-budget BELOW context so multi-file chunks fit 16k.) Then 4.2 god-node sanity check via.graphify_analysis.json; 4.3 confirm graph artifacts are gitignored/not vault-synced (ADR-008). - 5.1 — Update
docs/memory-system/05-implementation-process.mdstatus + Step 2 markers (2a/2b/2d executed; selected model = qwen2.5-coder:7b; the e4b/e2b inconsistency is resolved — see findings). NOTE: that doc currently claims 2a/2b "DONE" but they were only truly executed this round; reconcile honestly. - 5.2 — Verify with
/opsx:verifythen archive.
Re-run extraction if /tmp was wiped (reboot)
Fixtures live in the vault; recreate isolated dirs by copying the 6 source notes (slugs in scoring-results-2026-06-04.md Round-3 table) into per-fixture temp dirs, then run the working command above per fixture.
Pointers
- Findings + raw data:
docs/memory-system/benchmark/scoring-results-2026-06-04.md - Model-choice reference (incl. Triplex/purpose-built assessment):
docs/graphify/10-extraction-model-options.md - Task list + status block:
openspec/changes/graphify-ollama-setup/tasks.md - Optional cleanup: extra ollama variants from the investigation (gemma4-e4b-8k/16k, gemma4-e2b-8k/16k, qwen35-2b-8k/16k) can be removed with
ollama rm; KEEPqwen25-coder-7b-16k.