v1.20.64see what's new →

Loop + graph engineering

August 10, 2026

The 2026 stack has two layers: how one agent runs (loop engineering), and how many agents are wired (graph engineering). AGI CLI was built as a distributed agent factory — both layers, on the coding agents and machines you already use. The CLI command is still agents.

Prefer the visual longform (diagrams, LangGraph-style examples)? Open the shareable HTML edition.

The split

Loop engineering designs the observe → reason → act → verify cycle for one agentic node: skills, tools, secrets, permissions, durable state, recovery. Graph engineering designs topology across many nodes: who exists, who waits on whom, where they run, how work joins. The literature is clear that they compose — a graph of unengineered loops is an org chart of unreliable employees; excellent loops with accidental topology fail as coordination debt.

Industry names for this ladder (prompt → context → harness → loop → graph) are still settling. The practice is not: encode structure you already know, put model reasoning where it adds value, keep state outside the conversation.

Loop engineering in AGI CLI

Osmani's loop primitives map almost one-to-one onto the CLI surface. You design the system that prompts the agent — not each turn by hand.

Loop primitiveAGI CLI surface
Harness + versionagents add / use / view · profiles · model tiers
Skills & instructionsskills · rules · AGENTS.md
Connectors / toolsmcp · browser · computer · pty
Permissionspermissions · --mode plan|edit|auto|skip
Secretssecrets · run --secrets
External state / resumesessions · run --resume · export/import
Automations / heartbeatroutines · webhooks · monitors · watchdog
agents run claude "Land RUSH-1234" --mode edit --secrets eng --model best
agents sessions --active
agents sessions <id> --markdown --last 5

That is loop engineering operationalized across Claude, Codex, Grok, and the other harnesses under one binary — not re-derived per product.

Graph engineering in AGI CLI

Topology is not a research paper. It is named nodes, explicit edges, parallel ready sets, joins, and placement across machines.

Graph primitiveAGI CLI surface
Named nodesteams add … --name backend
Dependency edges--after backend,frontend (DAG; cycles rejected)
Parallel waveIndependent nodes launch together on start --watch
Isolation--enable-worktrees · boundary contracts
Placement--device pin · --devices pool
Steer / re-enterteams message · teams resume
agents teams create ship --enable-worktrees --devices yosemite-s0,yosemite-s1
agents teams add ship claude "API" --name backend  --worktree api --device yosemite-s0
agents teams add ship claude "UI"  --name frontend --worktree ui  --device yosemite-s1
agents teams add ship claude "E2E" --name qa --after backend,frontend --worktree qa
agents teams start ship --watch

There is no --before flag: declare the edge on the dependent node with --after. Wave 1 can run independent surfaces in parallel; QA is a multi-parent join.

They compose

Each teammate is a full coding-agent loop (Claude, Codex, …). The team is the graph. Devices and hosts are the fleet. That matches the literature's newer point: graph nodes are no longer single LLM calls — they can be whole agent runs. AGI CLI was already doing that with teams.

Inner loops are cyclic (tool call → observe → reason). The outer team schedule is usually a DAG. Both are true at once — LangChain's three-year graph note: loops are simple graphs; production systems still need cycles inside nodes.

Related on this site: harness engineering (the layer under the loop), teams recipe, sessions recipe.

Same patterns elsewhere

Not a bake-off — the same vocabulary shows up across the stack:

AGI CLI's niche is the coding-agent factory on your fleet: same shapes, harness-native, multi-product sessions, SSH placement — complementary to application graph libraries and enterprise gateways.

One recipe that uses both

# LOOP: skills + secrets + mode on every node
# GRAPH: DAG + worktrees + devices

agents teams create landing --enable-worktrees \
  --devices yosemite-s0,yosemite-s1 -d "Ship pricing page"

agents teams add landing claude "Implement pricing API" \
  --name api --worktree api --mode edit --model best

agents teams add landing claude "Build pricing UI" \
  --name ui --worktree ui --mode edit

agents teams add landing claude "Playwright + ship checklist" \
  --name qa --after api,ui --worktree qa --mode edit

agents teams start landing --watch
agents sessions --teams
agents teams message landing qa "Skip flaky snapshot; land the rest"

Further reading