Skip to main content
A large codebase is easier to navigate in neighbourhoods than file by file. After every build, Graphify Local splits the graph into communities: groups of functions, classes, files, and concepts that connect to each other more than to the rest of the code. Communities give GRAPH_REPORT.md its structure, colour graph.html, and let your agent say “this lives in the parsing layer” instead of listing fifty files.
Use communities when you join a new repository and want its real architecture, not the folder layout, or when your agent needs a short map of where a change belongs.

How it works

1

Partition

Graphify runs Leiden community detection on an undirected copy of the graph. If the Leiden package isn’t installed, it falls back to Louvain from NetworkX. Install graphifyy[leiden] for the better partition.
2

Down-weight weak edges

Edges tagged AMBIGUOUS count half as much (GRAPHIFY_AMBIGUOUS_SCALE, default 0.5), so a guess can’t glue two unrelated groups together. They stay in the graph for path and explain.
3

Split oversized groups

Any community holding more than 25% of the graph (and at least 10 nodes) gets a second Leiden pass on its own subgraph.
4

Number and score

Community 0 is the largest. Each one gets a cohesion score: the share of possible internal edges that actually exist.
5

Name

With a model configured, Graphify names each community in plain language. Without one, it keeps Community N placeholders.
Ordering is canonicalised before clustering, so the same graph gives the same communities on every run, on every machine.

See it in action

Re-cluster an existing graph without calling a model:
The report lists each one with its cohesion and members:
GRAPH_REPORT.md
graphify explain shows which community a node belongs to:

Configure

--missing-only keeps names you already have and only fills placeholders. Pick a model with --backend and --model; by default the backend is detected from your API keys.

What changes when the code changes

When you run update, watch, or a git hook, Graphify maps new communities onto the previous IDs by overlap, so “Community 12” stays the same group of code. A saved name is reused only while it still describes the community’s members; when a group changes enough, it’s renamed on the next label run.

Verify and troubleshoot

It’s the ratio of edges inside the community to the most it could have. Code graphs are sparse, so values like 0.02 to 0.1 are normal; compare communities against each other, not against 1.
No. They follow calls, imports, and references. A community that spans folders often shows a real dependency that the layout hides.

Run it on a second repository

These examples come from a code-only graph of the open-source httpx repository, built with Graphify Local 0.9.97. Your counts will differ.
graphify label . --missing-only with no backend configured keeps the placeholders and says why:
Communities also drive the pull request overlap view. graphify prs --conflicts lists pull requests that touch the same community; see pull request impact.

FAQ

Why did my community names change after update? When the community set changes, Graphify renames communities after their hub node and asks you to run graphify label.

What’s next

Deduplication and resolution

How edges and nodes are resolved before clustering.

Ask better graph questions

Use communities in your queries.

Try it in Graphify

We build and host the graph for you. Start with a 14-day Pro trial, then keep up to 3 repositories on Free. No card required.