Graph Engineering Explained: The Missing Fifth Layer of AI Agent Architecture
Every "my agent isn't working" postmortem starts the same way: someone rewrites the prompt. Adds a constraint. Adds an example. Ships it again. Three iterations later the agent still can't hold up in production, and the team is quietly out of ideas — because the prompt was never the layer that broke. There are five control layers standing between a raw model call and a system you can actually trust with a business outcome: prompt, context, harness, loop, and graph. Most teams staff and instrument only the first one or two. The failures that show up in production — wrong tool called, same mistake retried forever, output routed to the wrong reviewer — live almost entirely in the layers nobody named. Graph engineering is the newest and least understood of the five: it's the layer that decides which component runs next, when agents work in parallel versus in sequence, and where a human has to sign off before anything expensive or irreversible happens. This piece breaks down all five layers, works through a single production failure end to end, and shows where evals fit as the measurement system running through every one of them. The mental model: five rings around the model MODEL CALL = prompt + context AGENT = model call + harness + loop SYSTEM = agents + deterministic steps + humans, connected by a graph EVALS = evidence that every layer actually works Prompt and context sit closest to the model. Harness and loop turn a model call into something that can act and recover. Graph turns a collection of agents, functions, and human checkpoints into a coordinated system. None of these layers replace each other — they're concentric controls, not pipeline stages, and a production agent uses all five simultaneously. The weakest layer sets the ceiling on how reliable the whole thing is, no matter how good the other four are. Layer Controls Fails as Prompt Role, goal, constraints, output contract Ambiguous instructions Context What reaches the window: docs, history, tool results