Skip to content

feat(retrieval): reranker, type-weighted graph, MMR, importance, passage-window (v3.9.0)#50

Merged
Vahlame merged 2 commits into
mainfrom
feat/retrieval-accuracy-3.9.0
Jun 20, 2026
Merged

feat(retrieval): reranker, type-weighted graph, MMR, importance, passage-window (v3.9.0)#50
Vahlame merged 2 commits into
mainfrom
feat/retrieval-accuracy-3.9.0

Conversation

@Vahlame

@Vahlame Vahlame commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

Makes the kit's retrieval more accurate with five opt-in, off-by-default levers — each measured, with the default path byte-identical (deterministic retrieval-bench unchanged: recall@5 1.000 / MRR 0.984 / hit@1 0.969 / nDCG 0.988 / MAP 0.984) — plus real-defect hardening across Go/Node/CI.

Retrieval accuracy (ADR-0026/0027/0028)

  • Cross-encoder reranker behind the new [rerank] extra (fastembed TextCrossEncoder, lazy, durable cache, fail-safe fallback). CLI --rerank/--rerank-model, env OBSIDIAN_MEMORY_RERANK, and vault_hybrid_search(rerank: true). Default model is multilingual jina-reranker-v2. Off by default.
  • Type-weighted graph recall (graphTyped) — verb-weighted typed relations (supersedes/implements > relates_to).
  • Importance / in-degree (importance) — bounded hub boost; completes the relevance×recency×importance triad.
  • MMR diversification (mmr) + passage-window expansion (passageWindow, ranking-neutral richer snippet).
  • Harder golden set: negative queries scored separately in bench_recall (measure abstention without corrupting positive aggregates). Convex fusion evaluated → deferred.

Hardening

  • Go daemon: fix service Start/Stop goroutine + watcher leak (cancellable ctx), watch newly-created subdirectories, stop debounce timer on exit; new lifecycle tests.
  • Node MCP bridge: guard JSON.parse, clearer errors + Python-missing hint, advertise the real package version; accurate vault_fts_search description.
  • CI: prettier now covers .mjs/.js/.cjs/.ts (formatted once), test-node on Linux+Windows+macOS, go test -race on Linux.

Docs / surface

New ADR-0026/0027/0028; ARCHITECTURE + CHANGELOG; new knobs surfaced in AGENTS.md / .agents rules / installed memory-rules block (regenerated, no drift). All six version markers → 3.9.0.

Honest notes

  • New levers are situational by design (type-weighting/MMR are ~neutral on the generic single-relevant fixture; they help richly-typed / hub / topically-redundant vaults) — which is why they ship opt-in.
  • Reranker quality depends on model–language fit (an English ms-marco model lowered recall on the Spanish fixture); the default is multilingual.

Verification

All CI-exact gates green locally: go test, pytest (103), npm test (34+50), version:check, sync-agents:check, prettier, markdownlint, linkcheck (110), retrieval-bench gate.

🤖 Generated with Claude Code

Vahlame and others added 2 commits June 20, 2026 05:02
…age-window (v3.9.0)

Five opt-in, off-by-default retrieval-accuracy levers — each measured, the default
path byte-identical (deterministic retrieval-bench unchanged: recall@5 1.000 / MRR
0.984 / hit@1 0.969 / nDCG 0.988 / MAP 0.984) — plus hardening.

Retrieval (ADR-0026/0027/0028):
- Cross-encoder reranker behind the [rerank] extra (fastembed TextCrossEncoder,
  lazy, durable cache, fail-safe fallback); CLI/MCP/env surfaces; off by default.
- Type-weighted graph recall (verb-weighted typed relations) + importance/in-degree
  bias (bounded hub boost), both deterministic and opt-in.
- MMR diversification (stdlib, reuses stored chunk vectors) + passage-window
  expansion (ranking-neutral richer snippet).
- Harder golden set: negative queries, scored separately in bench_recall so they
  measure abstention without corrupting positive aggregates. Convex fusion evaluated
  and deferred.

Hardening:
- Go daemon: fix service Start/Stop goroutine+watcher leak (cancellable ctx),
  watch newly-created subdirectories, stop debounce timer on exit; new lifecycle tests.
- Node MCP bridge: guard JSON.parse, clearer errors + Python-missing hint, advertise
  the real package version; accurate vault_fts_search description.
- CI: prettier now covers .mjs/.js/.cjs/.ts (formatted once), test-node on
  Linux+Windows+macOS, go test -race on Linux.

Agent surface + docs: new knobs surfaced in AGENTS.md/.agents rules + installed
memory-rules block (regenerated, no drift); ADR-0026/0027/0028; ARCHITECTURE +
CHANGELOG; all six version markers -> 3.9.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The new cross-platform test-node matrix (this release) surfaced a latent
macOS-only failure: `safeVaultPath` correctly resolves symlinks, but the test
compared the result against the unresolved `os.tmpdir()` ("/var/folders/…"),
which on macOS is a symlink to "/private/var/…". Compare against `realpath(vault)`.
Code unchanged — the test's assertion was the naive part.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Vahlame Vahlame merged commit 5f53cae into main Jun 20, 2026
14 checks passed
@Vahlame Vahlame deleted the feat/retrieval-accuracy-3.9.0 branch June 20, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant