ar9av
|
a7fb1d69fe
|
feat(graphrag): graph-index query pre-pass eliminates speculative page reads
Adds obsidian-wiki graph-query <vault> "<question>" — queries the compiled
wikilink index before opening any page bodies, returning ranked candidates,
a should_read shortlist, and multi-hop paths. Replaces the current approach
of opening 5-10 pages speculatively per query.
- New obsidian_wiki/graphrag.py: build_index() (frontmatter + wikilinks,
in/out degree, tier), rank_candidates() (score = title/tag/summary match
+ degree bonus + tier weight), find_path() (BFS multi-hop, max_depth=4),
classify_query() (direct/path/gap/list routing), query() top-level entry.
- index_only=true when top candidate has exact title match + non-empty
summary — skips page reads entirely for lookup queries.
- CLI: graph-query <vault> "<question>" [--top N] [--max-read N] [--pretty]
- wiki-query SKILL.md gets Step 0: run graph-query first; use should_read
instead of speculative reads; skip to Step 5 when index_only=true.
- 34 new tests: index building, ranking, path finding, query classification,
integration, and CLI.
|
2026-06-30 13:52:53 -07:00 |
|