mirror of
https://github.com/Ar9av/obsidian-wiki.git
synced 2026-09-14 20:36:34 +08:00
a7fb1d69fe
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.
9.7 KiB
9.7 KiB