Agent Graphs, Isolation, Rollback and Harness Evaluation
Algomi Research · Created 2026-10-02 · Updated 2026-10-15 · AI Solutions Architecture & AI Engineering
Building a house
A family wants a house built. No single person does it all. A foreman coordinates:
- An architect makes the plan.
- Builders pour the foundation.
- Then the plumber and the electrician work at the same time, in different parts of the house, so they do not trip over each other.
- An inspector checks both. If the wiring is loose, the electrician is sent back, and the inspector looks again. The inspector does not accept "I'm sure it's fine".
- Before the family gets the keys, the owner signs off. Nobody hands over a house on the foreman's say-so alone.
- After move-in, a leak test runs. If the roof leaks, the keys are taken back and the problem is diagnosed.
That sequence has branches, parallel work, a loop (fix then re-inspect), a human gate and a rollback. A plain "do step 1, then 2, then 3" cannot express it. This is Part 3 of three, after foundations and loops, skills and tools. The house is the single example used here, and the Java code is named after it.
1. When a graph is worth it
As agent workflows grow, model them explicitly as a graph: nodes (steps or agents), edges (what follows what), shared state, and routing (which edge to take).
flowchart TD
P@{ icon: "algomi:svc-cube", label: "Plan", pos: "b", h: 52 }
F@{ icon: "algomi:svc-cube", label: "Foundation", pos: "b", h: 52 }
T@{ icon: "algomi:svc-cube", label: "Trades: plumbing + wiring in parallel", pos: "b", h: 52 }
I@{ icon: "algomi:svc-decision", label: "Inspect", pos: "b", h: 52 }
P --> F --> T --> I
X@{ icon: "algomi:svc-cube", label: "Fix", pos: "b", h: 52 }
I -->|fail| X --> T
O@{ icon: "algomi:svc-cube", label: "Owner sign-off", pos: "b", h: 52 }
H@{ icon: "algomi:svc-cube", label: "Handover", pos: "b", h: 52 }
L@{ icon: "algomi:svc-decision", label: "Leak test", pos: "b", h: 52 }
I -->|pass| O --> H --> L
D@{ icon: "algomi:svc-cube", label: "Done", pos: "b", h: 52 }
L -->|dry| D
R@{ icon: "algomi:svc-cube", label: "Rollback", pos: "b", h: 52 }
L -->|leak| RReading the diagram. The house build as a graph, read top to bottom.
- Plan → Foundation are plain steps, one after the other.
- Trades is one node that runs two workers in parallel (plumbing and wiring). Section 2 shows how that fan-out is wired.
- Inspect is a decision. On fail, the work goes to Fix, then back to Trades for re-inspection. That small cycle is a Part 2 loop inside the graph.
- Owner sign-off is a human gate. Nothing proceeds without it.
- Leak test is a check after handover. On leak, the graph takes the Rollback edge instead of finishing.
Each kind of shape (step, parallel step, decision, human gate, rollback) is one of the reasons listed below for using a graph at all.
Do not reach for graphs by default. Use one when several of these are true: specialisation, parallelism, shared state, conditional routing, independent verification, human approval, recovery paths, rollback, long-running execution. A task that is just "do, check, retry" is a simple loop (Part 2), and a single call is simpler still. Anthropic's guidance in Building effective agents is to add complexity only when it earns its keep.
You've reached the free preview of this post.
Subscribe to the Blogs plan (₹99/mo) — or use any Algomi Suite, Career, Investor, or Trader plan — to keep reading.
See plansSources
- Effective harnesses for long-running agents — Anthropic
- Building effective agents — Anthropic
- git-worktree documentation — Git
- OWASP Top 10 for LLM Applications — OWASP