DEV Community

Cover image for I mapped a 1,095-file repo into a knowledge graph in 5 minutes. Here's what it found.
Syed Fahad for Graphify Labs Inc

Posted on

I mapped a 1,095-file repo into a knowledge graph in 5 minutes. Here's what it found.

Last week I pointed an AI agent at our own repo and asked it one thing: draw me a map. Five minutes and twenty-five seconds later I had 4,022 nodes, 10,079 edges and a picture of our codebase I'd never seen before, even though I work on it every day.

Here's the full run, what came out, and how you can do the same on your repo.

The setup

The repo is Graphify-Labs/graphify, at commit dac0634. It has 1,095 files: Python source, tests, docs, examples and fixtures.

I ran it inside Perplexity Computer with the Graphify skill enabled. I typed /graphify, pasted the GitHub URL, and asked for a knowledge graph of the codebase. I didn't use a connector or upload anything. The agent cloned the public repo itself.

If you'd rather run it locally:

pip install graphifyy
Enter fullscreen mode Exit fullscreen mode

Then point it at any folder and let your coding agent (Claude Code, Cursor, Codex, whatever you use) query the graph.

What happened in 5m 25s

The agent picked the 105 files that carry the code's structure out of the 1,095 and parsed them into a graph:

Metric Value
Files mapped 105 of 1,095
Nodes 4,022
Directed edges 10,079
Communities 192
Wall-clock time 5m 25s

Every function, class and module becomes a node. Every call, import and containment becomes an edge. Then community detection groups everything into 192 clusters that roughly match how the code is organised.

Interactive graph map of the Graphify repo

What the graph told me

This is where I stopped skimming and started reading.

_read_text() is the most connected function in the repo, with 270 links. It's a tiny helper, and almost every extractor goes through it. If you're new to the codebase, this is the function to read first.

_make_id() comes second with 234 links. Every node in every graph gets its identity here. Changing it changes everything downstream, and the graph shows that before you touch it.

dispatch_command() calls 127 different functions. That's the CLI's front door. One node shows the entire surface area of the tool.

extract.py has a degree of 442. It's the gravitational centre of the project, which matches my gut feeling but now I have a number for it.

The graph also caught a stale line in our docs. ARCHITECTURE.md said to_html lives in export.py. The graph showed it's in exporters/html.py. One query, one fixed doc.

What you get at the end

The run produced three things:

  1. An interactive map you can pan, zoom and click through.
  2. A ZIP with graph.json, graph.html and notes, ready to drop into your agent's context.
  3. A written report of the hubs, communities and entry points.

The three artifacts from the run

graph.json is what matters for daily work. Instead of grepping and re-reading files every session, your agent asks the graph "what calls _make_id?" and gets the answer from structure, not similarity.

Try it on your repo

  1. pip install graphifyy
  2. Run it on your project folder.
  3. Ask your agent: "What are the five most connected functions, and what depends on them?"

I'd love to see what your graph says. Drop your node and edge counts, or the most surprising hub, in the comments. And if this was useful, a ⭐ on GitHub helps more developers find it.

Top comments (0)