Accueil / Articles / Graph Engineering Explained: Nodes, Edges and LangGraph in Practice

Cet article est publié en anglais.

Graph Engineering Explained: Nodes, Edges and LangGraph in Practice

Is graph engineering new? A look at prompt, context, harness and loop engineering, what defines a graph, and an 11-node LangGraph agent example.

997 mots

Every few months, AI engineering grows a new "-engineering" label, and the latest one is graph engineering. The phrase spread widely after a post from Peter Steinberger, who created the open-source autonomous agent OpenClaw and now works at OpenAI, so it reached a lot of timelines. The reasonable reaction is to ask whether it names something new or is simply another buzzword.

Short answer: it's mostly a new name for something agent builders already do. Here's the longer version.

A short history of the labels

The field has gone through a few naming waves already.

Prompt engineering came first. It means writing prompts precise and clear enough that the model understands what you need.

Context engineering followed, once a prompt alone couldn't carry everything the agent needs before starting a task. You attach more material, such as screenshots, markdown files and code, so the agent grasps both your intent and your environment.

Harness engineering was probably the biggest step. Rather than just handing the agent information, you build an environment around it: project details, the tools it can use, memory of earlier work, and policies and guardrails that keep it inside the lines.

Loop engineering is next. You tell the agent to keep iterating on a problem until it meets a success criterion. A typical case is a summarizer asked to write a report on some topic and then keep refining its own draft against a quality bar it checks itself, instead of passing it to a separate reviewer step.

The point is to cut down your own involvement by delegating the testing step to the agent. You no longer inspect every iteration and give feedback. The agent assesses the current output against the criteria and corrects its own approach. There's a downside, since an agent left alone can also run wild and burn through your tokens. Still, if the ideal is a system with no human in the loop, this moves toward it.

Most people building agents were already doing this long before the label appeared. It's the vocabulary that's new, not the principle. Graph engineering follows the same pattern.

What makes something a graph

Three ingredients define a graph.

  1. Nodes. A node is a discrete unit of computation with one identifiable job: a function that takes the current state and returns an update. In LangGraph, you register one with graph.add_node(name, fn).
  2. Edges. An edge carries control from one node to another. In LangGraph, graph.add_edge(a, b) means node b becomes eligible once node a finishes. Direction matters, so a leads to b and not the reverse. Conditional edges exist too. With graph.add_conditional_edge(a, func), the function runs after node a and picks the node that goes next.
  3. The shape. Nodes and edges together form a pattern, and that structure only appears when you look at the connected whole.

Graph engineering in practice

To see how it feels, consider an agent built with LangGraph that picks a meeting place for a group of two to five people who live far apart and argue over which neighborhood makes sense. It weighs real factors, such as travel time and the number of bus changes each person faces, instead of simply picking the midpoint of the map.

Eleven nodes make up the graph, and every one does a single thing. They narrow the search area, test reachability for each person, shortlist neighborhoods, look up venues, score them and finally review the outcome. There are no conditional edges, so on paper the structure is linear, with each step leading to the next and no branching.

The LangGraph code that defines it is straightforward:

# Initialize the graph with our shared state schema.
graph = StateGraph(MeetingState)
graph.add_node(”node0_search_area”, search_area_node)

# list the nodes
# register one reachability node per possible party member
for index, node in enumerate(REACHABILITY_NODES):
graph.add_node(f”reach_person{index + 1}”, node)
graph.add_node(”nodeC_shortlist”, shortlist_node)
graph.add_node(”nodeD_spots”, spot_finder_node)
graph.add_node(”nodeE_score”, scorer_node)
graph.add_node(”nodeF_review”, reviewer_node)

# list the edges
graph.add_edge(START, “node0_search_area”)
for index in range(len(REACHABILITY_NODES)):
graph.add_edge(”node0_search_area”, f”reach_person{index + 1}”)
graph.add_edge(f”reach_person{index + 1}”, “nodeC_shortlist”)
graph.add_edge(”nodeC_shortlist”, “nodeD_spots”)
graph.add_edge(”nodeD_spots”, “nodeE_score”)
graph.add_edge(”nodeE_score”, “nodeF_review”)
graph.add_edge(”nodeF_review”, END)

# Compile into a runnable graph.
compiled = graph.compile() Engineering w/ a Project

That's the whole graph, and it reads like a plain pipeline.

What the structure buys you

Even a linear graph has practical benefits. Every node reads from and writes to one shared state object, so you can see exactly what each step changed. A failing step is easy to isolate and rerun, because it's a small function with a defined input. You can swap or improve one node, say the venue scoring, without touching the others. And once a branch or a retry loop becomes necessary, adding a conditional edge is a small change and not a rewrite.

None of that is exotic. It's ordinary software design applied to agent workflows, which is why the label sounds more dramatic than the idea.

So what is it?

Graph engineering isn't a new concept. It's a fresh name for an approach that's become common as more people build agents. If you haven't tried it, give it a go with LangGraph or whichever framework you already like. The label matters less than the habit: break the work into small, single-purpose steps, make the connections between them explicit, and keep the shared state clear.