Brain commands connect Obsidian vaults and markdown directories to the code knowledge graph. Once added, notes, headings, sections, wikilinks, and tags become queryable alongside code symbols — the same PPR-based context retrieval works across both worlds. Use .brainignore for glob exclusion patterns or --ignore for ad-hoc filtering.
Command Description Key Flags brain addIndex a vault into the knowledge graph --name, --instance, --db, --config, --ignorebrain removeRemove a vault (cascade-deletes nodes; files untouched) --instance, --dbbrain listList all indexed vaults with note counts --json, --dbbrain statusShow vault counts, staleness, and index health --json, --db, --configbrain refreshForce re-index of a vault --name, --instance, --db, --since, --ignore
Command Description Key Flags brain searchBM25 full-text search across notes and symbols --limit, --json, --config, --prfbrain contextUnified PPR context across code + notes --token-budget, --limit, --kinds, --repos, --vaults, --path-prefix, --tags, --exclude-tags, --intent, --json
Command Description Key Flags brain watchWatch vault for changes and re-index --name, --instance, --db, --ignore, --config, --refresh-wiki-hoursbrain stale-checkCompare indexed SHA against git HEAD --json, --dbbrain reindex-searchRebuild the Tantivy BM25 search index --db
Command Description Key Flags brain broken-linksList wikilinks with ambiguous/low-confidence targets --max-suggestions, --limit, --jsonbrain orphansList notes with zero inbound and outbound wikilinks --vault, --path-prefix, --allow, --limit, --jsonbrain topic-clustersDetect topic clusters via Leiden community detection --resolution, --limit, --jsonbrain tag-graphShow tag note count and co-occurring tags --limit, --jsonbrain doc-statsOne-shot health summary --top-tags-limit, --json
Command Description Key Flags memory lintHealth checks: stale notes, broken links, orphans --json, --configmemory consolidatePropose/apply tier promotions (dry-run by default) --apply, --json, --configmemory relatedTyped-edge traversal from a note --edge-type, --depth, --json
nestweaver brain add ~/Documents/Obsidian/MyVault
# Add with a custom name and ignore patterns
nestweaver brain add ~/notes --name work-notes --ignore " drafts/**,archive/** "
nestweaver brain list --json
nestweaver brain search " authentication flow "
# Search with pseudo-relevance feedback for better recall
nestweaver brain search " payment processing " --prf --limit 10
# Unified context with filtering
nestweaver brain context " authentication " --token-budget 4000 --kinds Symbol,Note
# Filter to specific tags
nestweaver brain context " billing " --tags " project/freeplay " --exclude-tags " archive "
# Filter to specific repos or vaults
nestweaver brain context " deployment " --repos my-api --vaults work-notes
Token efficiency
Use --kinds, --tags, --repos, and --path-prefix filters on brain context to narrow results and reduce token usage. The --token-budget flag truncates output to fit an approximate token count, ideal for LLM context windows.
# One-shot health summary
nestweaver brain doc-stats
# Find broken wikilinks with suggestions
nestweaver brain broken-links --max-suggestions 3
nestweaver brain orphans --path-prefix Workspaces/
nestweaver brain topic-clusters --resolution 0.5
nestweaver brain tag-graph project/myproject
nestweaver memory lint --json
# Propose tier promotions (dry-run)
nestweaver memory consolidate
nestweaver memory consolidate --apply
# Traverse typed relationships from a note
nestweaver memory related note:abc123 --edge-type Supersedes --depth 3
memory consolidate proposes promotions from daily logs to ideas to project files. Dry-run by default — use --apply to move files. memory related walks Supersedes, DependsOn, CausedBy, and RelatesTo edges.