Traverse your vault knowledge graph with Cypher queries
Use Cypher queries to traverse the typed edge graph built from your vault’s frontmatter wikilinks. Includes patterns for common knowledge-graph lookups.
After indexing, smolbren builds a directed property graph from your vault: note types (the type frontmatter key) become node labels, and frontmatter keys that contain wikilinks become relationship types. The node ID is the note’s vault-relative path without the .md extension — for example, blogs/context-engineering. You query this graph with Cypher, the same query language used by Neo4j and other graph databases.Every smolbren query call prints a single line of JSON to stdout:
Note is a catch-all label that matches every note in the vault, regardless of its type value. Use it to query across multiple types or when you don’t know the exact label:
smolbren query \ "MATCH (n:Note) WHERE n.type IN ['blog','journal'] RETURN n.id, n.title, n.type"
Pass runtime values into queries with --param key=value. The flag is repeatable:
smolbren query \ "MATCH (n:blog)-[r:mentions]->(m) RETURN m.id, count(r) AS c ORDER BY c DESC LIMIT \$limit" \ --param limit=5
smolbren JSON-parses the value first, so:
--param value
Cypher type
--param limit=10
integer 10
--param active=true
boolean true
--param id=blogs/context-engineering
string "blogs/context-engineering"
--param tags=["a","b"]
JSON array
If JSON parsing fails, the value is passed as a plain string. This means you almost never need to add quotes — just write --param id=blogs/context-engineering, not --param id='"blogs/context-engineering"'.
Note is a catch-all label that matches every note in the vault — typed or not. Use (n:Note) when you want to reach nodes of any type or when the target label of a relationship is unknown. It is always registered automatically, even if no note has type: Note in its frontmatter.
Body text and raw frontmatter JSON are not projected in query results. The graph engine loads only id, path, type, and title per node for performance. If you need the body or arbitrary frontmatter scalars like status, use smolbren get <id> (or smolbren get <id> --body) to fetch the full note record after your query identifies the relevant IDs.