PTENES
Skip to content
TRACK 1

🔵 Fundamentals: the graph

Before discussing “graph engineering,” the foundation: what a graph is. It's the simplest data structure after the list—just two ingredients, nodes and edges—and you already use dozens of them every day without knowing it. This learning path defines each term the first time it appears.

weight 2 weight 5 edge at the at the at the at the at the (node) graph = nodes + edges. That's it.

What to look at: the dots are the in nodes (the things) and the lines are the edges (the connections). Two lines have a number—that number is the weight, and it’s what turns a nice-looking diagram into a structure you can use to calculate (the shortest, cheapest, fastest path). Remember these three words: node, edge, weight.

3
Modules
18
Topics
~2h
Duration
Basic
Level
Learning path progress
0%0 of 18

Learning path map

Detailed content

1.1~40 min

🔵 What is a graph

Node, edge, direction, weight, cycle. That's the difference between a graph, a tree, and a list—and what makes everything else make sense.

What it is:

The node is a thing of your world: a person, a task, a process step, an AI agent. In code, it appears as n or node.

Why learn:

Choosing what becomes a node is the first modeling decision—and the one people get wrong most often. If the node is too large, the graph doesn’t help at all; if it’s too small, you drown in detail.

Key concepts:

Node = noun. A node has an identity (you can point to it) and can carry data (label, cost, owner, state).

What it is:

The edge is the relationship between two nodes. In code, e or edge. “Depends on,” “becomes,” “knows,” “passes the result to.”

Why learn:

In an agent system, the edge is where the decision lives: “if approved, go here; if rejected, go back there.” And the value lies more in the edges than in the nodes.

Key concepts:

An edge = a verb. It can have a type (typed edge), direction, and weight. A graph without edges is just a list of disconnected things.

What it is:

In a graph directed, an edge has an arrow: it goes from A to B and doesn’t go back along that edge. In an undirected graph, the connection works in both directions (like friendship, for example).

Why learn:

Every agent workflow is directed: the researcher hands off to the writer, not the other way around. Direction is what gives the system order.

Key concepts:

Directed = arrow = order. If you want to go back, that’s another edge (and it can have its own rule: “go back only if rejected”).

What it is:

A number attached to the edge: minutes, dollars, tokens, probability, distance. That’s what turns a “drawing” into a “computable structure.”

Why learn:

Without weights, all you know is if you can proceed; with weights, you know which path is worthwhile. And that's where search and optimization come in.

Key concepts:

Weight can represent cost (minimize) or gain (maximize). In an agent graph, the weight is usually latency, token cost, or confidence.

What it is:

A path that leaves a node and returns to it. If a directed graph has no cycles, it is a DAG (directed acyclic graph).

Why learn:

This is the turning point of the entire course: a loop is a cycle. A loop is the simplest graph there is—one node with an edge that points back to itself.

Key concepts:

DAG = no way back = ends on its own. With a cycle = can repeat = needs a stopping condition, or it runs forever.

What it is:

A list = each item has one next item. A tree = each node has just one parent, with no cycles. A graph = anything can connect to anything. Lists and trees are special cases of graphs.

Why learn:

Many people draw a tree (epic → story → task) and think they've solved it—until a cross-branch dependency appears. That's when the tree becomes a graph.

Key concepts:

If there's a cross-dependency, it's a graph. Don't force a tree onto a problem that's a graph — you'll only hide the real dependency.

View Full
1.2~40 min

🌍 Graphs in the real world

Your morning, LinkedIn, your SaaS funnel, your team's backlog, and the documentation your agent reads. All graphs.

What it is:

Wake up → get up → brush your teeth → coffee. Each step is a node; the time between them is the edge weight (2 min, 5 min, 3 min).

Why learn:

And the smallest example that already shows everything: nodes, directed edges, weights in minutes — and an alternative path (someone brings you coffee in bed) that skips a node.

Key concepts:

Modeling = choosing what is a node and what is a weight. An alternative path = another edge, not another graph.

What it is:

Each person is a node; each relationship is a weighted edge (friendship, work, shared interests). “You are 3 connections away from Lucas” = 3 edges apart.

Why learn:

And the example that shows that the algorithm navigates the graph for deciding what to show you. The same idea applies to your agent navigating documentation.

Key concepts:

Distance in edges = “degrees of separation.” Edge weight = strength of the connection. Recommendation = traversal with criteria.

What it is:

Campaign → traffic → signup → activation → subscriber → churn → LTV. Nodes are customer states; edges are conversion rates.

Why learn:

And the example that exposes the course’s central problem: optimizing a an edge (lowering CAC) can worsen another (increasing churn) without anyone noticing.

Key concepts:

One metric is never enough. The graph lets you see the side effect instead of only the main effect.

What it is:

An epic contains stories, a story contains tasks, and a task contains subtasks. It looks like a tree — until one story depends on another. Then it becomes a graph.

Why learn:

This is how a PM decides how many people (or agents) can work in parallel: the graph shows which branches don’t block one another.

Key concepts:

A dependency edge = a blocker. Independent branches = potential parallelism. Split up the task and design the graph so you don’t block anyone.

What it is:

Instead of dumping dozens of files .md loose in folders, you link the documents to one another and specify the type of link (“prerequisite for,” “contradicts,” “details”).

Why learn:

The agent stops reading everything and starts navigate: enter through the right node and follow the relevant edges. Less context wasted, more precision.

Key concepts:

Warning: this is knowledge graph, a cousin—but not a synonym—of graph engineering. Track 3 separates the two.

What it is:

Module A imports B, B imports C. The npm, o make, your CI—both build a directed graph and determine the order from it.

Why learn:

It’s the closest example to what you’ll do with agents: the build already handles “what runs in parallel” and “what waits” exactly like a work graph.

Key concepts:

Circular dependency = cycle = build error. The tool detects cycles — your agent graph will need to detect them too.

View Full
1.3~40 min

🧭 How to move through a graph

Traversal, shortest path, topological order, parallelism, and cycle detection—the toolkit you’ll use in Track 4.

What it is:

In breadth (BFS) you visit all the neighbors before going deeper; in depth (DFS) you follow one path all the way down before backtracking.

Why learn:

It’s the same choice you make with agents: scan many options shallowly (breadth) or pursue one path to the end (depth).

Key concepts:

Breadth finds the closest one first. Depth finds a fast response. Mark who has already visited — otherwise a cycle becomes an infinite loop.

What it is:

Find the lowest-cost route between two nodes by adding up the edge weights. The path with the fewest hops isn’t always the cheapest.

Why learn:

In an agent graph, the “cost” is tokens, latency, or risk. Choosing a route means choosing how much you'll spend to reach the same result.

Key concepts:

Fewer edges ≠ lower cost. If the weight changes over time (API latency), the optimal path changes too.

What it is:

A valid DAG execution queue: nothing runs before what it depends on. That’s what the make calculates.

Why learn:

It’s literally the scheduler for your agent graph: it tells you what can run now and what has to wait.

Key concepts:

A topological order exists only if there are no cycles. If the algorithm can't order it, it has found a circular dependency.

What it is:

How many nodes are ready at the same time. If two branches don’t block each other, two workers fit—two developers or two agents.

Why learn:

This is how you size the fleet: there’s no point launching 20 agents if the graph only releases 3 nodes at a time.

Key concepts:

Parallelism is a property of the graph, not your enthusiasm. Break the task into parts that do not block each other increases the width.

What it is:

B waits for A, A waits for B: no one moves. In an agent graph, this becomes routing that bounces back and forth between two nodes forever.

Why learn:

And one of the failure modes new that the graph provides and the loop didn’t have. It needs a repetition limit and explicit detection.

Key concepts:

Every cycle needs an exit: an iteration limit, a progress criterion, or human approval. A cycle without an exit = an infinite bill.

What it is:

In practice, a dictionary: for each node, the list of neighbors. {"pesquisa": ["escrita"], "escrita": ["revisao"]}.

Why learn:

Because this is how you’ll write your agent graph in JSON/YAML and hand it off to the orchestrator — without any framework if you don’t want one.

Key concepts:

An adjacency list works for almost everything. Store the node data too (model, tools, prompt) — that’s what makes it a graph agentic.

View Full