Technical Deep Dive

Amp vs. Graph-Based
Coding Agents

Why the Graph Is Elegant — And Why Amp Already Implements It

AmpGraph-Based AgentsState MachinesRegulated Industries

A response to the LinkedIn post on graph-based coding agents • July 2026

ESL — AI SDLC Tools Consultants
Engineering Software Lab • eswlab.com
Daniel Liezrowice
CEO & Co-Founder, ESL
02 - The architecture

The Graph from the Post

The LinkedIn post presents a “Full graph” architecture - a coding agent state machine built in LangGraph, based on a work methodology from Anthropic. Read these as executable transition systems - not process art. This is impressive work. But let me show what Amp already does natively.

FIG. 1 — Full graph

STARTINTAKESPECPLANSTRATEGYMILESTONE LOOPCLOSE_OUTQAVERDICTDONE
                     └── reopen ×2 ──┘

FIG. 2 — Milestone loop

BRANCHIMPLEMENTTESTGATE_AE2E (only if has_ui)GATE_BPRCIMERGE

DEBUG (waits for human) → BRANCH
“Read it as a state machine, not a flowchart. Guards are evaluated in table order and exactly one must match.” — the post
03 - The formal model

What's Actually Being Built

The diagram isn't a flowchart — it's a finite state machine with guard conditions. Each transition is a guarded rule evaluated deterministically. This is serious engineering:

What LangGraph Gives You

  • Graph definition: nodes are Python functions
  • State object using TypedDict
  • Conditional edges
  • Guards as boolean predicates
  • SQLite/Postgres checkpoint persistence
  • Token-level streaming

What Must Be Built

  • 18 nodes total
  • ~25 guard conditions
  • State schema with 30+ fields
  • Checkpoint/resume logic
  • Human-in-the-loop integration
  • Git, CI, tests, and PR API tools
Engineering effort: A team of 2-3 engineers would spend 4-8 weeks on the state machine infrastructure alone — before the agent writes its first line of useful code.
04 - The boilerplate

What the Code Actually Looks Like

Here's what a single node + guard from the milestone loop looks like in LangGraph:

class AgentState(TypedDict):
    request: str; spec: str; plan: list; strategy: str
    milestones: list; current: int; code: dict; tests: dict
    test_passed: bool; lint_errors: list; blocked: bool
    reopen_count: int; has_ui: bool; approved: bool; verdict: str

def implement_node(state: AgentState) -> AgentState:
    response = llm.invoke(build_prompt(state))
    state["code"] = dispatch_tools(response.tool_calls)
    return state

def branch_router(state: AgentState) -> str:
    if state["blocked"] and state["strategy"] == "debug": return "debug"
    if state["blocked"] and state["reopen_count"] < 2: return "reopen"
    if all_done(state): return "close_out"
    if state["strategy"] == "D": return "stop_early"
    return "implement"

graph.add_node("implement", implement_node)  # ...seven nodes here
graph.add_conditional_edges("branch", branch_router, routes)
app = graph.compile(checkpointer=PostgresSaver(conn))
That's ~400 lines of boilerplate for 7 of the 18 nodes. Multiply across all nodes, guards, state fields, tests, and CI integration — that's 3,000-5,000 lines of infrastructure code before the agent does anything useful.
05 - The 1:1 mapping

Every Node in the Graph → Amp Built-in

Here's the key insight: every single node in the diagram has a native Amp equivalent that requires zero custom infrastructure.

NodeWhat It Does in the GraphAmp EquivalentEffort
INTAKEParse requestAgent conversation: you describe the taskZero config
SPECWrite formal specAgent writes spec; oracle validatesZero config
PLANDecompose milestonesplan_before_acting + oracleZero config
STRATEGYSelect A/B/C/Dagent_mode: low/medium/high/ultraZero config
BRANCHSelect milestoneTask subagents for parallel milestonesZero config
IMPLEMENTWrite codeedit_file, create_file, shell_commandZero config
TESTRun testsshell_command runs tests inlineZero config
GATE_AReview qualityoracle: GPT-5.6 reasoningZero config
E2EUI testing if has_uiui-preview skill + view_mediaSkill load
GATE_BFinal revieworacle holistic intent reviewZero config
PRCreate pull requestthread_interact ship_or_push_changesZero config
CIRun CIshell_command local CIZero config
MERGEMerge mainthread_interact workflowZero config
DEBUGWait for humanNative approval modelZero config
CLOSE_OUTSummarizeFinal summary + read_threadZero config
QAFinal qualityoracle + verification loopZero config
VERDICTPASS/BLOCK/FAILAgent report + wait_for_threadsZero config
reopen ×2Return to loopLoop until success criteria passZero config
Score: 18/18 of the nodes mapped to Amp built-in capabilities. Zero lines of custom infrastructure.
06 - Amp's execution model

How Amp's Tool Stack Replaces the Graph

No graph code needed. This is Amp's execution model:

USER REQUESTAMP AGENT (MAIN THREAD)
  01 Read code     02 Plan       03 Review plan   04 Implement
  05 Test          06 Gate A     07 E2E / UI      08 Gate B
  09 Ship          10 CI         11 Verify        12 Report

  ┌── MULTI-AGENT ─────────────────────────────────────────┐
  │ create_thread → Task A │ Task B │ Task C               │
  │                    wait_for_threads → integrate         │
  └─────────────────────────────────────────────────────────┘
  ┌── HUMAN-IN-THE-LOOP ─────┐  ┌── SCHEDULING ───────────┐
  │ approval model            │  │ set_schedule            │
  │ user steering             │  │ update_schedule         │
  └───────────────────────────┘  └─────────────────────────┘

Core Tools

Read, search, edit, create, shell, browser, media, git workflows.

Intelligence Layer

Oracle review, subagents, context-aware planning, and semantic verification.

Lifecycle & Ship

Approvals, retries, tests, CI, PR, merge, schedules, and final reporting.

07 - The gate nodes

Oracle: A Smarter Gate Than Hand-Coded Rules

The GATE_A and GATE_B nodes use static guard conditions. Amp's oracle uses GPT-5.6 reasoning to review the actual diff.

LangGraph: static checks

def gate_a(s):
  if s["failed_tests"]: return "reject"
  if s["lint_errors"]: return "reject"
  if s["diff_lines"] > 500: return "review"
  return "pass"

# Knows only predefined failures.
# Cannot assess intent or architecture.

Amp: semantic review

oracle(
  "Review this diff against the user's intent.
   Check semantics, architecture, race conditions,
   type safety, regressions, and missing tests.
   Return concrete findings with evidence."
)

# Reads the diff and reasons about what changed.
# Finds risks you did not know to encode.
CapabilityLangGraph gateAmp oracle
Deterministic output
Catches predefined failures
Unanticipated bugs / intent mismatch / drift
Architectural risk and type safety
Auditable for compliancePartial
Zero maintenance
EffortDays per gateOne tool call
08 - Parallel milestones

The Milestone Loop Without the Loop

The graph processes milestones sequentially through the loop. Amp parallelizes them natively.

LangGraph: sequential

M1: IMPLEMENT→TEST→GATE→E2E→GATE→PR→CI→MERGE
M2: IMPLEMENT→TEST→GATE→E2E→GATE→PR→CI→MERGE
M3: IMPLEMENT→TEST→GATE→E2E→GATE→PR→CI→MERGE

Parallelism requires custom fan-out, state management, dependency handling, error states, and fan-in.

Amp: native fan-out

create_thread(task="Milestone 1")
create_thread(task="Milestone 2")
create_thread(task="Milestone 3")
wait_for_threads(ids)
oracle("Review integrated result")

About 10-20 lines of orchestration, including review.

ConcernLangGraphAmp
Parallel executionCustom codecreate_thread × N
JoinCustom fan-inwait_for_threads
DependenciesCustom guardsSpawn order
Failure isolationCustom error stateFailed thread doesn't block others
Lines of code500-80010-20
09 - The DEBUG node

The DEBUG Node vs. Amp's Native Approval

The diagram says DEBUG “waits for a human.” Here's what that costs in LangGraph vs. what Amp gives for free:

LangGraph

def debug_node(state):
  ticket = notify_human(state, channel="slack")
  answer = wait_for_approval(ticket, timeout=86400)
  return process_response(state, answer)

~300-500 lines of glue: notification, approval API, webhook, timeout, serialization, resume logic, and UI.

Amp approval model

Zero code. Amp pauses naturally at a decision point. You type:

  • “Yes, proceed.”
  • “No, try X.”
  • “Let me check.”

thread_interact gives you explicit steering of child threads.

The difference is architectural: the graph treats human-in-the-loop as a node that must be built and wire in. Amp treats it as the fundamental execution model — every node is implicitly a DEBUG node.
10 - Beyond the graph

Capabilities the Diagram Doesn't Cover

Amp has features the state machine doesn't even address:

Scheduling & Monitoring

set_schedule with RRULE and update_schedule. LangGraph has no scheduler; you'd add cron, Celery, or Airflow.

Skills System

20+ domain packages: building-schedules, ui-preview, claude-mythos-cve, parasoft-static-analysis, stm32f103c8-bluepill-dev. No LangGraph equivalent.

External Code Understanding

Librarian reads GitHub repositories. LangGraph needs custom RAG plus a vector database.

Web Research

web_search + read_web_page. LangGraph needs custom tools and a search API.

11 - Honest assessment

Where the Graph Engineering Approach Still Wins

This isn't one-sided. The graph-based approach has real advantages in specific scenarios:

1. Deterministic, Auditable Transitions

Python guards can prove the machine never enters an invalid state. Critical for FDA 510(k), ISO 26262, IEC 62304, and DO-178C.

2. Custom Tool Integrations

Proprietary APIs at each node are more flexible in LangGraph — important for enterprises with bespoke toolchains.

3. Visual Audit Artifacts

The diagram is a real, inspectable artifact an auditor can trace. Amp execution is conversational.

4. Cost Control & Token Budgets

You control which nodes call LLMs and which are pure logic. Amp consistently relies on LLM reasoning.

The approach wins when you need determinism, auditability, and explicit control. Amp wins when you need speed, intelligence, and zero infrastructure. The right choice depends on the regulatory environment and toolchain.
12 - The decision framework

For Regulated-Industry Work

If working in regulated spaces, here's the decision matrix:

ScenarioUse AmpUse LangGraphHybrid
Exploratory development✅ AmpOverkill
SBOM generation✅ AmpOverkill
Code fixes & refactoring✅ AmpOverkill
Security reviews✅ Amp + skillsAmp reviews; graph formalizes
FDA submission pipeline✅ AuditAmp works; graph proves process
ISO 26262 safety case✅ AuditAmp implements; graph validates
CI/CD automation✅ Amp + scheduling
Formal review gates✅ OracleIf auditableOracle + graph audit log
The hybrid pattern: Use Amp as the execution engine — it implements, tests, triages, ships. Use LangGraph (or a formal FSM) only for the compliance layer — proving to auditors that the process followed a deterministic path. This gives Amp's intelligence inside the graph's audit trail.
90%Amp Coverage
18/18 nodes
100%Graph-Based Audit
deterministic trace
100%Hybrid
Amp executes + graph audits
13 - The same task, two ways

Complete Workflow: The Graph vs. Amp

Task: Implement a feature, test it, review it, and ship it.

LangGraph — ~1,200 lines

class State(TypedDict):
  # 50 state fields

# 18 node functions
# 25 guard functions
# graph assembly and conditional edges
# checkpointer.compile()
# app.invoke(initial_state)
# ~500 lines of tests

Amp — ~15 lines, zero infrastructure

# You ask for the feature, then Amp uses:
finder("Locate feature architecture")
read_file(paths)
oracle("Review implementation plan")
edit_file(...); create_file(...)
shell_command("run focused tests")
oracle("Gate A: review diff")
skill("ui-preview"); view_media(...)
oracle("Gate B: holistic review")
thread_interact("ship")
MetricLangGraphAmp
Infrastructure / test code1,200 / 500 lines0 / 0
State fields / guards50 / 250 / 0
Build time4-8 weeks0 minutes
Add node2-5 daysJust ask
MaintenanceOngoingNone
Deterministic auditabilityFullConversational
Intelligence per gateStaticGPT-5.6
14 - The bottom line

The Verdict

Amp is the better tool for 90% of engineering work. The graph-based approach is the right choice only when you need deterministic, auditable state transitions — and even then, a hybrid approach is optimal.

Use Amp When...

  • You want to ship features, not infrastructure
  • Your small team can't afford 4-8 weeks
  • You need intelligent code review
  • You want parallel milestones without fan-out code
  • You need built-in scheduling
  • You value domain skills and web research
  • The work is exploratory, not regulated
  • You want zero orchestration maintenance
  • You need to iterate fast
  • You want a complete tool stack immediately

Use the Custom Graph When...

  • Transitions must be provable to an auditor
  • FDA, ISO, IEC, or DO-178C governs the work
  • FSM diagrams are formal deliverables
  • You need bespoke tool integrations
  • You need explicit LLM cost control
  • You have a dedicated platform team
  • Checkpoint/resume needs formal serialization
  • The same input must follow the same path
The optimal architecture for regulated work: Execution layer: Amp agent. Compliance layer: a custom graph FSM. Review layer: Amp's oracle as the intelligent gate. Audit layer: read_thread + find_thread to extract execution history into compliance documentation.
15 - Quick reference

Complete Feature Comparison

Print this as a one-page decision matrix.

CapabilityAmpLangGraph
Intake / SpecNative conversation + oracleBuild nodes
PlanningNativeBuild node
Strategy selectionAgent modeCustom guard
ImplementationBuilt-in toolsCustom tools
TestingShell inlineBuild integration
Code review gateOracle reasoningStatic/custom
E2E / UI testingSkill + browser + mediaCustom
Final reviewOracleBuild node
PR creation / MergeNative workflowAPI integration
CI pipelineShell/workflowCustom tool
Debug / human waitNative approvalBuild node + UI
Close-out / SummaryNativeBuild node
QA verdictReasonedGuard logic
Reopen / RetryNative loopEdges + state
Parallel milestonescreate_threadCustom fan-out
SchedulingBuilt-in RRULEExternal scheduler
External code understandingLibrarianCustom RAG
Web researchBuilt-inCustom API
Domain expertiseSkillsCustom prompts/tools
DeterminismPartialFull
AuditabilityConversation historyFormal state trace
Infrastructure codeZero3,000-5,000 lines
Time to buildImmediate4-8 weeks
MaintenancePlatform-managedYour team
Cost per taskLLM-heavyControllable
Intelligence per gateSemantic reasoningEncoded rules
Closing

Build Software, Not Infrastructure

The state machine is already built. Try Amp.

The diagram is architecturally elegant — a formal state machine with 18 nodes, 25 guards, and deterministic transitions. It's also 4-8 weeks of infrastructure work that Amp gives you for free on day one.

Every node in the graph — INTAKE, SPEC, PLAN, STRATEGY, IMPLEMENT, TEST, GATE_A, E2E, GATE_B, PR, CI, MERGE, DEBUG, CLOSE_OUT, QA, VERDICT — has a native Amp equivalent that requires zero code.

The one thing Amp can't give you is the formal audit trail the hand-built state machine provides. For regulated work, that's real. The solution isn't to build the whole graph in LangGraph — it's to let Amp do the work and wrap it in a thin compliance layer.

Amp: ExecutionGraph-Based: ComplianceOracle: IntelligenceHybrid: Optimal

Try Amp at https://ampcode.com • Published July 2026

ESL — AI SDLC Tools Consultants
Engineering Software Lab • eswlab.com
Daniel Liezrowice
CEO & Co-Founder, ESL
← Swipe to navigate →