Back

A practical guide to Graph Engineering by GoML

Sarankumar S

August 18, 2026
Table of contents

Simply put, graph engineering describes how a certain logical process goes through the tasks prior to the model carrying it out. A certain agent may fail for reasons that might be difficult to explain several steps later. For instance, in the first part there was one source that the first node missed. The second node received the information that the first one had missed and came to the same faulty conclusion. A certain reviewer reads a paper which is so clear and convincing that people agree with it. The report is sent to the client, however, when the fault occurs later on, it gets to the conclusion that it has no idea why the method has failed.

This may look like a prompting failure, even when the original prompt was followed correctly. Rewriting the prompt will not fix a task whose structure allows missing evidence, weak assumptions and unclear responsibility to pass from one step to another. The real problem lies in how the work was arranged before the model started reasoning, including which tasks run in parallel, which ones wait, what evidence moves between steps, where a failed decision gets recorded and where a person makes the final call.  

The model does the reasoning, while the graph decides how that reasoning moves through the work, what each step receives, what it returns and whether the final decision can be traced back to the point where it went wrong.

Where GoML stands on this

This is a design position drawn from delivery experience and from published research, including a framework that its own authors describe as untested at scale. We are writing it down now because the architectural argument is strong enough to act on and specific enough to measure. Treat the claims here as hypotheses we intend to test against our own runs, and read the evidence section before adopting anything wholesale.

Why chat hides the graph engineering

Treating research, analysis, writing and review as one linear sequence is an oversimplification, and real work rarely follows that shape. Many of the sub-tasks inside it are independent of each other. Pricing research and security research, for example, don't depend on each other's output, so they should run in parallel rather than one after another.

A review shouldn't be performed by someone who shares the same assumptions and mindset as the report's author that's what makes it a review rather than a second draft. Running everything inside one long chat doesn't change this. Even when the conversation is continuous, the underlying tasks still depend on each other in specific ways, and folding them into one dialogue doesn't make those dependencies disappear.

Image

Anthropic makes a good distinction between workflows (determined by code) and agents (which operate according to decision-making). In this way, graph engineering ensures that both work under one umbrella. Code resolves decisions which are obvious, while models deal with ambiguous ones.  

One of the simplest rules results from this division. If you can use straightforward code to arrive at a decision, do not waste time on a model call. Create three independent tasks instead of wasting a call. If confidence is below a certain limit, route the query to a review process. If the maximum number of retries is reached, stop.  

All these rules are graph, and even a model is likely to make mistakes while performing them for reasons beyond your control.

The graph engineering control plane has four parts

You do not need graph theory to build one. You need four things, and the discipline to keep them separate.

State

State is the job’s memory, held outside the chat window. It carries the original brief, collected evidence, node status, retry counts, approvals, budget consumed, and final artifacts. The transcript is not state. Most of a transcript is conversational debris that costs tokens on every downstream call and buries the few facts that routing depends on.

Nodes

A node owns one bounded job. collect_pricing is a node. verify_claims is a node. "Research everything, work out what matters, write the report, and make sure it is correct" is a workflow hiding inside a prompt, and it will fail as one.

Edges

An edge answers one question: what is allowed to run next. Some edges are fixed. Others read state. Evidence complete goes to write. Evidence weak goes back to research. Sources disagree goes to human review. Budget exhausted stops and returns a partial result with a reason attached.

Gates

A gate blocks bad work from moving downstream. It can be a schema validator, a test, a permission check, a deterministic rule, an evaluator model, or a human approval. A graph without gates is a faster way to distribute mistakes.

Build graph engineering around failure, not the happy path

Most workflow diagrams show how everything succeeds. Production behaviour is defined by everything else.

Before adding a single agent, write down five outcomes for every node that matters.

  • Start with an operation your team performs regularly.
  • Map it as boxes draw what happens, step by step.
  • Write down what data moves along every route between boxes.
  • Mark every decision point: each choice, every action that comes from outside the system, every plausible failure path, and every point that needs human sign-off.
  • Simplify the map: merge any nodes you can't reason about independently of each other.
  • Cut model calls anywhere plain code can make the same decision.
  • Split apart any tasks that need separate, non-overlapping context.
  • Add a verifier before the final output ships.
  • Set the stop rule up front decide before you build what makes the system give up and return a partial result, rather than figuring it out after something has already gone wrong.

This changes how you prompt a verifier. Asking "is this good?" returns an opinion the graph cannot act on. Asking for a route returns something executable.

{

 "decision": "retry",

 "reason": "Two revenue claims have no primary source",

 "target": "collect_company_data"

}

Errors in agent systems compound. One weak assumption becomes context for the next step and evidence for the step after that. Grounding each node in environmental feedback and setting explicit stopping conditions, including a maximum iteration count, is the part most teams postpone and then pay for during an incident.

What the research claims about graph engineering

In a paper published in April 2026, titled From Agent Loops to Structured Graphs: A Scheduler-Theoretic Framework for LLM Agent Execution (arXiv 2604.11378), the authors present the idea in a formal manner which might be useful. The authors define the agent loop as a single-ready-unit scheduler that at a given instant employs one executable unit with the selection of the next executable unit being determined by the inference which cannot be analyzed.  

The authors suggest using a Structured Graph Harness that allows control flow to exit from the context window and be represented by an explicit static graph ensuring three obligations.

Commitment one: plan immutability within a version

The execution plan is generated, locked, and fixed for the duration of that plan version. The agent cannot quietly revise it halfway through. The restriction is the point. An agent that rewrites its own plan mid-run is an agent whose trace no longer matches the plan you would audit afterwards. The cost is real: a genuinely novel situation is handled worse by a locked plan than by a loop that adapts freely. The commitment is a deliberate bet that predictable beats maximally adaptive for a specific class of work.

Commitment two: separated layers

Planning, execution and recovery live in three independent layers with defined interfaces. The planning layer produces the plan and does nothing else. The execution layer runs steps and reports outcomes, pass or fail with evidence attached, and forms no opinion about what happens next. The recovery layer reads failure reports and applies a protocol. This mirrors the reasoning that keeps a builder separate from a judge. Collapse the layers and the trace can no longer tell you which function failed.

Commitment three: strict escalation

Recovery follows a fixed ladder with a defined attempt count and a defined handoff point. The paper’s survey of 70 agent systems found that loop implementations commonly lacked any formal bound on recovery attempts. In practice that shows up as infinite retry on a stubbornly failing approach, or premature abandonment when a transient error triggers an unnecessary replan.

The caveat that matters

The authors state plainly that whether this design delivers its promised benefits in practice remains an open empirical question. The framework is a survey-backed proposal, not a benchmarked result. We reference it because the failure modes it names match what we see in real agent runs, and because it is specific enough to falsify. Anyone quoting the three commitments as proven engineering practice is overstating the record.

A verified graph engineering research flow, walked through

Take a task an enterprise team runs constantly. Compare three AI coding products and produce a sourced recommendation for a 20-person engineering team.

The single-agent version searches, reads, compares and writes inside one context window. It is simple to build. It also blends discovery, judgment and prose into one artifact, so a failure has no address.

The graph version separates the work.

  1. Scope turns the request into explicit criteria: price, privacy, deployment model, model support, administration, migration cost. The output is a schema.
  1. Four collection nodes run in parallel across documentation, pricing, security posture and user evidence. Every worker returns the same shape.

{

 "claim": "The enterprise plan supports SSO",

 "source": "https://...",

 "source_type": "official_docs",

 "published_at": "2026-07-12",

 "confidence": "high"

}

  1. Normalize runs in code. Deduplicate URLs, reject records with missing fields, standardise dates, group claims by product. No model call is required, so no model call is made.
  1. Challenge takes the strongest claims and tries to break them, searching for contradictory documentation, stale pricing, region restrictions and missing caveats. Rejected claims route back to the specific collection node that produced them.
  1. Human gate receives unresolved contradictions and high-impact recommendations only. Routine evidence keeps moving.
  1. Synthesize receives verified evidence, the decision criteria and the open caveats. It never sees the raw research transcript.

That last detail carries more weight than it looks. Context should follow the edges of the graph instead of accumulating in one window. Anthropic has demonstrated a related pattern with code execution and MCP, where intermediate data stays inside the execution environment and the model sees only what is explicitly returned, reducing context load, latency and unnecessary exposure of sensitive data.

Verification needs its own branch

Do not ask the same agent to produce and approve its work in the same context. It knows why it made each choice, which makes it a poor skeptic. A stronger verification branch has different information and a narrower job. The worker proposes a claim. A deterministic check validates schema and source URL. A verifier tries to reject the claim against explicit criteria. A human sees only high-impact disagreements.

The verifier returns evidence, never a vibe.

{

 "pass": false,

 "failed_rule": "primary_source_required",

 "unsupported_claims": [3, 7],

 "next_action": "research_again"

}

Evaluations belong in the design phase. Early evals force a team to define what success means, and later they supply baselines for quality, latency, token usage, cost and regressions. Inside a graph those evals stop being reports and become gates.

Why graph engineering needs its own verification branch

Agent graphs can raise output quality while quietly destroying latency and unit cost. Track all three budgets per run and put the limits in state.

Time

Parallel branches reduce wall-clock time only when the branches are genuinely independent. Every join waits for the slowest one, so a single slow specialist sets the pace for everything downstream of it.

Tokens

Each additional worker, judge, retry and synthesis call carries a price. Passing structured evidence between nodes instead of whole transcripts is the largest single lever most teams have available, and it costs nothing but design attention.

Risk

Reading a documentation page and issuing a payment should not share one permission policy. Autonomy is granted per node, against the blast radius of that node’s worst outcome.

Attach per-node token caps, a workflow deadline, retry limits and permission levels to state. When a budget is exhausted, return the best partial result with a clear failure report. An agent left to improvise its way out of an exhausted budget will find an expensive way to do it.

When a graph is the wrong call

Graph engineering is not a reason to turn every prompt into infrastructure. Use one model call when the task is short, low risk and easy to inspect. Use a simple chain when every step genuinely depends on the one before it.

Reach for a graph when at least one of these becomes true.

  • Independent work can run in parallel.
  • Different inputs need different specialists or tools.
  • Failures need retries, fallbacks or escalation.
  • The run must survive interruption and resume from state.
  • A high-impact output needs independent verification.
  • Humans should approve specific decisions without supervising every action.

Exploratory work argues the other way. Open-ended research, debugging where the root cause is unknown at the start, and creative work that rigid structure would flatten all favour a loop. Locking a plan for a task that depends on adaptive replanning removes the exact capability that made the task worth automating.

The patterns compose inside one system. A pragmatic design puts a graph at the outer level for overall structure and stop conditions, and allows a loop inside a single execute node for the exploratory sub-task of working out how to implement one step. Auditability where the shape matters, improvisation where the details do.

How we would test graph engineering before trusting it

Each commitment fails quietly when implemented loosely, so we treat each one as something to attack before it reaches a client workload.

Attack the immutable plan

Construct a mid-run situation where the obviously correct next move deviates from the locked plan. The system should escalate. If it adapts silently, the plan was immutable on paper and mutable in practice, which is the worst of both positions: no real flexibility and no trustworthy audit trail either.

Attack the layer separation

Read the execution layer’s failure reports looking for opinions. A phrase like "this probably needs a different approach" inside what should be a neutral pass or fail record means recovery logic has leaked upstream. The separation has been relabelled rather than built.

Attack the escalation limit

Feed the system a failure that no defined recovery attempt can fix. It should stop cleanly at the defined limit instead of inventing a third approach. This is the same test as checking a loop’s stop condition against an unsolvable task, and it catches the same class of quietly expensive failure.

Then track one number that a loop cannot give you cleanly: escalation rate, broken down by which specific recovery attempt failed. A graph escalating repeatedly at the same step is telling you that step’s protocol is miscalibrated. The failure point is a named state rather than an inferred moment inside a transcript, which is most of the diagnostic value on offer here.

Ship the graph

Initiate with an operation that your group performs regularly. Illustrate what it looks like in terms of boxes. Write down what data is transferred on every route. Identify every choice point, any action from outside, other possible unsuccessful paths and any human agreement required. Then simplify it. Combine every node that you cannot analyze independently. Remove the calls to models that can be implemented in your code. Break down tasks that need separate context. Introduce the verifier before the output. Include the stop rule before starting from scratch.  

At the end of the diagram, you will get the architecture. With LangGraph you can represent workflows as states, nodes, and conditions. AutoGen GraphFlow allows sequential, parallel, conditional, and loop workflow execution. The architecture development concept of Anthropic can be about routing, parallelization, orchestrators and workers and evaluators and optimizers.

The shift

Prompt engineering asks what the model should say or do next. Graph engineering asks what information should exist at each step, who acts on it, what evidence supports the result and where failure goes. This thinking also shapes GoML’s very own AI Matic platform where agent work can be organized around defined tasks, handoffs, checks and human decisions instead of relying on one long chain of conversation. It is the difference between a demo that worked once and a system whose decisions can be traced, reviewed and trusted when it runs again.

Frequently asked questions

The paper admits it's unproven at scale, so why act on it now?

This is because the underlying logic (separate the planner from the doer from the judge) isn't new or unproven that part's just applied systems design. The paper formalizes why loops fail; you don't need a benchmark to trust that reasoning, just to know the exact size of the improvement.

Doesn't a locked plan bring back rigid workflow-engine problems?

Yes, partly. The blog acknowledges that a fixed plan can handle new situations less effectively than a loop that can adapt freely. A better approach is to combine both: keep the overall plan fixed where an audit trail is needed, while allowing a local loop to adapt within a step when the details are uncertain.

If the reviewer needs different context than the author, why trust the verifier?

It's not foolproof separating roles removes one failure mode (author rubber-stamping their own logic), not all of them. That's why only high-impact or contradictory cases escalate to a human instead of trusting the verifier's pass/fail outright.

https://arxiv.org/abs/2604.11378