Graphs: From Knowledge Graphs to Multi-Agent Collaboration
Last lesson’s trees were well-behaved: one parent each, never a cycle. Real-world relations are messier—friends are friends with each other; companies, schools, and people tangle. Tear up “one parent only,” and a tree upgrades to a graph: nodes + relations, wire them however you like. This lesson covers graph’s two home turfs in AI.
Below is a mini knowledge graph: dots are entities (people, companies, schools, products); lines are relations. Click any node and watch relations ripple out—watch the “hop count”: one hop is direct, two hops is a “friend of a friend.”
Now a crew of Agents co-writes a research report. Each box is a task; arrows mean “can’t start until upstream finishes.” Hit “Run” and watch two things: tasks with no mutual deps light up together (parallel); each waits until every arrow source turns green. Then hit “Create a cycle” and run again—see what happens.
A tree is a graph’s “well-behaved kid”
A tree is a graph with two house rules: one parent each, and no cycles. So last lesson’s file trees and ASTs can use graph algorithms too—graph is the bigger umbrella.
Graph = nodes + relations
Just that formula. Social nets (people + follows), maps (intersections + roads), knowledge graphs (entities + facts), Agent workflows (tasks + deps)—if you can say “who relates to whom,” you can draw a graph.
What this lesson wants to share
- Relations are graphs: node + relation is a graph; a tree is just the special case with “one parent, no cycles”
- Multi-hops find answers: walk two or three relation hops and answer questions no single doc states
- No cycles, or no start: a cyclic workflow waits forever—so it must be a DAG
- Parallelism hides in the graph: independent tasks can run together—that’s how multi-Agent setups speed up
- When checking, ask: for an AI-orchestrated workflow—“Did you cycle-check? Which steps run in parallel?”