Your vault has a graph. But you can only stare at it.
Graph view is great for exploring, but it can’t answer questions — “Which notes have the most links?” “How many hops
between these two concepts?” “Which notes would break the network if removed?” “How many notes are completely isolated?”
I built an AI agent skill that runs graph algorithms directly on your vault’s link structure via the Obsidian CLI, and
explains the results in natural language.
What you can ask
┌───────────────────────────────────────────────────┬────────────────────────────────────────────────────────┐
│ You say │ What happens │
├───────────────────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ “Which notes have the most links?” │ Degree analysis, ranks hub nodes by link count │
├───────────────────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ “How are [[Note A]] and [[Note B]] connected?” │ BFS shortest path with full route │
├───────────────────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ “What’s around [[this note]]?” │ N-hop neighbor expansion │
├───────────────────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ “Which notes would break the network if removed?” │ Tarjan bridge detection + articulation points │
├───────────────────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ “Find orphan notes” │ Full vault scan, zero-link notes with frontmatter info │
└───────────────────────────────────────────────────┴────────────────────────────────────────────────────────┘
How it works
The skill has 7 JS query templates (BFS neighbors, shortest path, connected components, iterative Tarjan, degree
calculation, orphan scan, frontmatter relations). Your AI agent picks the right template, substitutes your vault config
(excluded folders, relationship fields), and runs it via obsidian cli eval. Data source is
app.metadataCache.resolvedLinks — Obsidian’s live link index.
Tested on a 2,000+ note vault.
Requirements
- Obsidian with CLI enabled (Settings > General > Command-line interface)
- Any supported AI agent — Claude Code, OpenClaw, Cursor, Cline, GitHub Copilot, Windsurf, and 30+ more
Install
npx skills add azuma520/obsidian-graph-query
Then restart your agent and say “help me set up graph query vault config” — the agent will walk you through excluded
folders, relationship fields, etc.
Open source, MIT licensed. Feedback and contributions welcome.