Skip to main content
The query command executes a Cypher query over the knowledge graph that smolbren builds from your vault. Every indexed note becomes a graph node and every wikilink found in frontmatter fields becomes a typed relationship. This lets you traverse your vault’s structure with the full expressive power of Cypher — finding paths, filtering by property, aggregating connections, and more.

Synopsis

Arguments and flags

string
required
A Cypher query string. Quote it in your shell to prevent word-splitting. Projection names in the RETURN clause become the column names in the response. Both node patterns (n:Label) and relationship patterns ()-[:TYPE]->() are supported.
string
A query parameter as a key=value pair. Repeatable — pass --param multiple times to supply several parameters. Reference parameters in your Cypher using the $key syntax. Values are parsed as JSON first (so integers, booleans, and floats work as their native types); if JSON parsing fails the value is treated as a plain string.

Graph schema

The graph is derived entirely from your vault’s frontmatter and wikilinks. No manual schema definition is required. Node labels correspond to the type value in each note’s frontmatter (e.g. blog, project, org). Every note is also available under the catch-all label Note, regardless of whether it has a type field. Node label matching is case-insensitive. Relationship types correspond to the frontmatter key that contained the wikilink. For example, if a note has mentions: ["[[projects/prism]]"] in its frontmatter, an edge of type mentions is created from that note to projects/prism. Node properties available in queries include the physical fields below and every scalar frontmatter key whose name is a valid identifier. Property names are case-insensitive and normalized to prevent duplicate Cypher fields. Strings, numbers, and booleans retain their types. Lists and maps are intentionally omitted. Dates written in canonical ISO form (YYYY-MM-DD) remain strings whose lexical ordering is chronological. This makes weekly and recency queries straightforward:
Use smolbren types to list all node labels in your vault, and smolbren edges to list all relationship types, before writing queries.

Output format

Returns a single JSON object with two fields:

Parameters

Pass runtime values using --param to avoid string-interpolating user input into your Cypher:
Values are coerced by type:
  • --param limit=5 → integer 5
  • --param active=true → boolean true
  • --param name=alice → string "alice" (JSON parse fails, falls back to string)
  • --param tags=["a","b"] → JSON array ["a","b"]

Examples

Find all blog posts and their titles
Traverse a relationship — find what a blog post was merged from
Filter by property with a parameter
Two-hop traversal — blogs that mention projects for a specific org
The body, complete frontmatter object, list values, and map values are not available as node properties. Use smolbren get <id> --body after identifying the note ID from a query when you need those values.