Skip to content

[wiki] index.md: use mixed wikilink+markdown format for agent navigation outside Obsidian #228

Open

Description

@C-Hung85

The --wiki flag is documented as "agent-crawlable" — the intent is that any agent can navigate the knowledge graph
by reading index.md and following links. This is a compelling feature, especially for committing wiki/ to git so
cloud-hosted LLMs (e.g. Claude Code Web) can access graph context without needing a local graphify installation.

Current behavior

index.md uses Obsidian wikilink syntax for community and god node links:

## Communities

- [[API: Auth & Session Layer]] — 38 nodes
- [[Database / ORM Models]] — 21 nodes

The actual files on disk are generated via _safe_filename():

  • API-_Auth_&_Session_Layer.md
  • Database_-_ORM_Models.md

Problem

An agent not running inside Obsidian (e.g. an LLM reading files from a git clone) sees
[[API: Auth & Session Layer]] and cannot resolve it to a file path — the transformation
rules (spaces→_, /→-, :→-) are applied by _safe_filename() but are not documented
anywhere in the output. The wikilink is a dead end for standard file-based navigation.

Proposed fix

Use the mixed [label] format — Obsidian understands it as a wikilink, and standard markdown
renderers and agents follow the explicit relative path:

wiki.py, _index_md()

filename = _safe_filename(label) + ".md"
lines.append(f"- [{label}] — {len(nodes)} nodes")

This is a ~1-line change in _index_md() and _god_node_article(), fully backward-compatible.

Verified against source

Tested against graphifyy installed via uv tool install. The _index_md and _safe_filename functions are in
graphify/wiki.py.

Diff (2 lines in graphify/wiki.py)

--- a/graphify/wiki.py
+++ b/graphify/wiki.py
@@ _index_md() — community links @@
     for cid, nodes in sorted(communities.items(), key=lambda x: -len(x[1])):
         label = labels.get(cid, f"Community {cid}")
-        lines.append(f"- [[{label}]] — {len(nodes)} nodes")
+        lines.append(f"- [[{label}]]({_safe_filename(label)}.md) — {len(nodes)} nodes")

@@ _index_md() — god node links @@
     for node in god_nodes_data:
-        lines.append(f"- [[{node['label']}]] — {node['edges']} connections")
+        lines.append(f"- [[{node['label']}]]({_safe_filename(node['label'])}.md) — {node['edges']} connections")

Activity

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      No labels
      No labels

      Type

      No type

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions