graph

A command that turns indexed Markdown files into graph data: files or text chunks become nodes, and links or similarities become connections.

In plain words
What is it for?
Use it to provide nodes, connections, groups, topics, and connection types for a graph visualisation or analysis.
Why use it?
It makes relationships in a document collection easier to inspect or display. You can view the whole collection, a folder, or a named folder scope at file or chunk level.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/geckse/markdown-vdb/graph
Clone the repo
git clone --depth 1 https://github.com/geckse/markdown-vdb
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,296 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00017 $0.04296
Opus 5 $0.00009 $0.02148
Sonnet 5 $0.00003 $0.00859
Haiku 4.5 $0.00002 $0.00430

Measured 2d ago against content hash 10fdd55dc245, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

graph scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/cli/commands/graph.md · 453 lines

How it starts

The opening of the file, as written. The whole thing — 453 lines — stays where its author put it; the contents beside it link to each section on GitHub.

mdvdb graph

Show graph data (nodes, edges, automatic communities, Topics, and edge types) for visualization. The graph can be generated at document level (one node per file) or chunk level (one node per chunk within each file), then scoped by a folder or analyzed through a named Shard.

Usage

mdvdb graph [OPTIONS]

Arguments

This command takes no arguments.

Options

Flag Short Default Description
--level document Graph granularity level: document or chunk
--path Restrict visible graph topology to this collection-relative folder
--shard Use a configured Shard as the graph analysis context
--compact false With --json, emit the versioned compact wire format; alias --intern-contexts

--level <LEVEL>

Controls the granularity of the graph nodes.

Level Description
document (default) One node per indexed file. Edges are body links and frontmatter Relations between files. Clusters are document-level communities.
chunk One node per chunk within each file. Edges are the top-k most similar chunk pairs across different files (based on cosine similarity of embeddings). Intra-file edges are excluded.

At document level, edges come from body links and whole-value frontmatter Relations. At chunk level, edges come from embedding similarity (the top 5 most similar cross-file chunks for each chunk).

--path <PREFIX>

Restricts the graph to files whose paths start with the given prefix. Only nodes matching the prefix are included, and only edges between matching nodes are returned.

# Graph only for files under docs/
mdvdb graph --path docs/

# Graph only for API documentation
mdvdb graph --path docs/api/

--shard <ID>

Uses the named Shard as an independent analysis corpus. Only indexed documents below the Shard folder participate in automatic clustering, and only that Shard's local Topic definitions are used. Collection, parent-Shard, and sibling Topics do not leak into the response.

Read the full file on GitHub · 453 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 453 lines · 17 tokens per session scan A 10fdd55dc245

Subscribe to this mod's changes

graph is a command published in the GitHub repository geckse/markdown-vdb (23 stars, last pushed 18d ago), licensed MIT. It adds 17 tokens to every session and 4,296 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other commands, from other repositories