PTENES
MODULE 1.2

🕸️ Knowledge graph, demystified

Nodes, edges, communities, and god nodes — the vocabulary that makes the rest of the course obvious. Each word is defined the first time it appears; by the end, “graph” stops being jargon and becomes a mental image.

6
Topics
~45
Minutes
Basic
Level
0%
0 of 6
1

⚪ What a graph is (nodes and edges)

At its core, the whole course revolves around a simple structure: the graph. There’s no mystery—it’s the oldest way to draw “things and how they connect.” Think of a subway map: each station is a point, and each track is a line connecting two stations. The Graphify graph is exactly that, except instead of stations it stores ideas, and instead of tracks it stores relationships between ideas.

🔰 New here? What is a "graph"

A graph is a set of points connected by lines. The points are called nodes (in English, nodes) and the lines are called edges (in English, edges). Nothing more than that: a node = a thing, an edge = a link between two things. Forget the scary word “graph”—it’s a subway map.

Two details give the graph its power. The first is neighborhood: from one node, you can immediately see everything connected to it — its direct neighbors. The second is the degree of a node: how many edges leave it, or in other words, how many other things it connects to. A high-degree node is a busy intersection; a low-degree node is a dead end. Remember these two—they come up again in topics 3 and 4.

🔰 New here? "Neighborhood" and "degree"

Neighborhood of a node = all nodes connected to it by an edge. Degree = o number of these connections. A central station with many lines → high degree. An end-of-line station → low degree. Simple as that.

community Hooks Session Memory Subagents MCP Context Window god node (high degree)

↑ The circles are nodes; the lines are edges. The bright circle in the center has many connections (high degree) — it is the god node. The dashed line surrounds a well-connected group — a community. Everything that follows is in this one figure.

🔑 Key concepts

Node
A thing/idea
Edge
Connects two nodes
Neighborhood
Connected nodes
Degree
How many connections
2

🔗 Entities, relationships, and provenance

"Node" and "edge" are generic names. When Graphify actually looks at your content, it gives them more specific names: each node becomes a entity and each edge becomes a typed relationship. It's the same graph from topic 1 — just with precise terminology layered on top.

🔰 New here? "Entity" and "typed relationship"

A entity is an identifiable thing: an idea, a code function, a person, a concept ("Context Window," "Hooks"). A typed relationship is an edge that says what it is — not just “A links to B,” but “A uses B", "A is part of B", "A depends on B". The "type" is the label for the connection.

Each entity and relationship also carries an invisible label: the provenance — which file it came from. This lets the agent say “I read this in hooks.md, line such-and-such” instead of making it up. Provenance is what separates a reliable map from a pretty guess.

🔰 New here? "Provenance" and "reconciliation"

Provenance (in English, provenance) = the record of the origin of each piece of knowledge: which document produced it. Reconciliation = combine aliases for the same concept into a single node (e.g., “context window,” “context window,” and “ctx window” become one entity, not three). Without reconciling them, the same concept would appear scattered.

Here’s a vocabulary trap worth remembering: the video that inspires the course talks about “concepts” and “connections”; in practice, the tool says “entities” and “relationships.” They’re the same thing with different names. Knowing both keeps you from getting stuck when the GRAPH_REPORT.md using one term while the video uses another.

🛠️ What the tool says

  • ›Entity — a named, typed node.
  • ›Relationship — a labeled edge (uses, contains…).
  • ›Provenance — the source file for each item.

🎬 What the video calls it

  • ›Concept — the same as entity.
  • ›Connection — the same as relationship.
  • ›"Where It Came From" — the same as provenance.

🔑 Key concepts

Entity
Named node
Typed relationship
Labeled edge
Provenance
Which file it came from
Reconciliation
Combine aliases
3

🫧 Communities and the Leiden algorithm

When you have hundreds of nodes, you’ll notice that some groups interact a lot with each other and little with the rest — like cliques at a party. These groups have a name: communities. In the diagram in topic 1, the dashed line circled one of them. Communities are what turn a tangle of points into a set of themes readable.

🔰 New here? "Community" and "clustering"

A community is a group of nodes that are closely connected to one another and loosely connected to those outside the group. Clustering (clustering) is the general name for the task of "finding the natural groups" in a set of data. Community detection is clustering on a graph.

But who decides where one community begins and another ends? An algorithm—and the one Graphify uses is called Leiden. You don't need to understand its math; you just need to know that it scans the graph on its own and returns the groups, without you having to label anything by hand.

🔰 New here? What is "Leiden"

Leiden is the name of a community detection algorithm (named after the Dutch city). For you, it’s a useful black box: a graph goes in, cohesive groups come out. It’s the successor to an older algorithm (Louvain), with more "tightly knit" groups.

Under the hood, in plain language, Leiden repeats three steps until it can’t improve any further:

1

Each node in its own group

Start with everyone isolated—no cliques yet.

2

Bring together what connects strongly

Each node “moves” to the group of neighbors it has the most edges with.

3

Repeat until stable

Refines and starts over as long as the groups become more cohesive. Then it stops.

💡 Why this matters to you

Each community becomes a theme of your project — and, in the Obsidian export, a named group on the canvas. That's how a graph of 600 nodes becomes less intimidating: you navigate dozens of topics instead of hundreds of disconnected points.

🔑 Key concepts

Community
Cohesive group
Clustering
Find groups
Leiden
The algorithm
Theme
Named community
4

🌟 God nodes: the graph's hubs

Remember the bright node at the center of the diagram? That was the god node: the most connected entity in the graph, the intersection that almost everything passes through. In a graph of Claude Code documentation, "Context Window" is often a god node — dozens of other concepts point to it.

🔰 New here? What is a "god node" / "hub"

A god node (literally "god node") is simply the node with degree higher—the one with the most edges. Another name for it is hub (center). There's nothing mystical about it: it's the graph's connection hub. The GRAPH_REPORT.md already lists the god nodes for you.

Why should you care? Because god nodes are the best starting points to ask the agent. Instead of starting with an obscure concept tucked away in a corner, you start with a hub and let the agent “go down” through the neighborhood. It’s like entering a city through the central station, not through an alley.

✓ Start with a god node

  • ✓Covers many topics at once.
  • ✓Gives the agent a rich neighborhood to navigate.
  • ✓Already listed in the report — no treasure hunt.

✗ Start with a leaf node

  • ✗Low degree: few connections to follow.
  • ✗The agent hits a dead end.
  • ✗You lose sight of the big picture.

💡 Usage tip

When you open the graph for the first time, go straight to GRAPH_REPORT.md, read the list of god nodes and use the first one as the starting point for your first question. It’s the fastest shortcut to “understanding what project this graph is about.”

🔑 Key concepts

God node
The most connected
Hub
Central intersection
High degree
Many edges
Entry point
Where to start
5

🗺️ GraphRAG: map vs. search

Now let's bring it all together in an acronym you'll hear a lot: GraphRAG. To understand it, start with simple "RAG." When an agent needs to answer questions about documents that don't fit in the context window, it search the most relevant passages and pastes them into the context before answering. This is RAG.

🔰 New here? What is "RAG"

RAG = Retrieval-Augmented Generation (retrieval-augmented generation). In plain English: before answering, the system retrieves (search) retrieves useful text snippets and delivers them to the model. The retrieval is just this step of "fetching what matters." Standard RAG works with chunks — loose snippets of text.

The problem with ordinary RAG: it returns a pile of unrelated snippets. The model receives standalone pages and has to guess how they connect. The GraphRAG solves this by retrieving on top of the graph: beyond the excerpts, it provides the relationships between them—neighborhood, community, god nodes. Text + map, not isolated text.

🔰 New here? What is "GraphRAG"

GraphRAG is RAG that uses a knowledge graph as a source. Instead of returning only passages similar to the question, it returns the passages e how they connect. It’s the difference between getting newspaper clippings and getting an annotated infographic. Graphify is, at its core, a tool for building this GraphRAG graph.

RAG · flat chunks snippet about hooks… snippet about context… snippet about subagents… snippet about MCP… standalone pages — unrelated to one another GraphRAG — chunks + relationships context hooks subagents MCP the concept and its neighbors together

↑ Same question, two answers. Standard RAG dumps disconnected passages; GraphRAG delivers the concept e its neighborhood. That’s why the map answers faster and with fewer hallucinations.

🔑 Key concepts

RAG
Search + answer
Recovery
Go fetch snippets
GraphRAG
RAG over a graph
Structured context
Excerpts + relationships
6

⚡ Why the map helps the agent

To wrap up the module, here’s the practical payoff. With the map in hand, Claude Code knows what's close to what. You ask about subagents; instead of scanning the entire repository with grep, it jumps straight to the “Subagents” node, reads the neighborhood from it—“agent teams,” “separate context,” “orchestration”—and responds in the right context.

🔰 Quick reminder: “browse the neighborhood”

Explore the neighborhood is going from a node to its direct neighbors, then to their neighbors — following edges as if they were corridors. That's exactly what grep no does: it finds where the word appears, but doesn’t know how to follow the connections. The map does.

The benefits grow with the size of the project. In large repositories, reading everything is expensive and slow; following the map is cheap and direct. That's the selling point of the whole stack: better answers from large codebases, because the agent spends its context window on what matters, guided by relationships instead of guessing.

✓ With the map

  • ✓Goes straight to the right node and its neighborhood.
  • ✓Uses the window only for what’s relevant.
  • ✓Answers with relationships, not just snippets.

✗ Without the map

  • ✗Scans files with grep, aimlessly.
  • ✗Fills the window with irrelevant text.
  • ✗Loses the connections between concepts.

🔑 Key concepts

Neighborhood
What’s nearby
Navigation
Follow edges
Right context
On-point answer
Efficiency
Low-cost for large datasets

✋ Self-recovery (optional, non-blocking): what is a god node in the graph?

📌 Module summary

✓
Graph = nodes + edges: the subway map of ideas, with neighborhoods and degree.
✓
Entities and relationships: the tool's actual vocabulary; each item carries provenance.
✓
Communities via Leiden: cohesive groups become navigable themes without you tagging them by hand.
✓
God nodes: the high-degree hubs — the best starting points.
✓
GraphRAG: retrieval that returns excerpts e relationships — a map, not a pile of pages.

Next module

1.3 · Graphify under the hood — the CLI and skill, how it extracts (AST vs. LLM), and what it outputs to the folder graphify-out/.