← narwal.one/Second Brain
SecondBrain
Ask the Brain
Index/Conceptupdated Sat Sep 26 2026 08:00:00 GMT+0800 (Philippine Standard Time)

Agentic Loop

agentsreact-patternagentic-loopreasoningtool-useneuro-symbolic

Agentic Loop

The execution pattern that makes an LLM into an agent rather than a chatbot. Also called the ReAct pattern — Reason, Act, observe, repeat.

The loop

  1. Task arrives (via Slack, iMessage, CLI, API, etc)
  2. Assemble context: conversation history + long-term memory + system instructions + available tools
  3. Send to LLM for reasoning
  4. Need a tool?
    • Yes → execute the tool, get result, append to context, go back to step 3
    • No → return final response
  5. Loop until no more tools needed
  6. Respond

"And that, my friends, is the core pattern behind every agent framework out there." — What is OpenClaw (IBM Technology)

Where it appears in this wiki

  • OpenClaw — explicit ReAct implementation around its Gateway
  • Claude Code — same pattern, with extensions like /loop and sub-agents adding meta-loops on top
  • Blitzy — autonomous-platform variant; the loop runs entirely server-side without IDE interaction
  • Printing Press — CLIs are tools the loop can call; designed for short, clean tool outputs

A role-labeled view of the same loop (Sandeep)

You're Not Behind (Yet) Learn AI Agents (theMITmonk) gives the same mechanism with role labels instead of step labels — useful when explaining agents to non-technical audiences:

Role What it does in one pass of the loop
Analyst Finds the pattern in raw inputs
Planner Decides what matters and what to do
Operator Executes — calls tools, produces output
Auditor Checks the result, refines

The four roles aren't separate processes — they're labels for what one LLM is doing on successive passes of the ReAct loop. Useful framing for board-level / CMO explanations.

The same source contributes OODA Loop as the adversarial-speed framing layered on top of the agentic loop — ReAct is the mechanism; OODA is the bar.

Workflow vs agent — the one-line distinction

Per Cedric Clyburn (Essential Skills for Becoming an AI Engineer (IBM Technology)): a workflow follows a predefined path (step A → B → C); an agent dynamically decides what to do next — call a tool, observe the result, loop. "Building these loops is what's really important… one who can do this reliably and at scale, well, that's a good AI engineer." He calls agents & tool use "probably the most in-demand applied AI skill right now."

Variants worth knowing

  • One-shot retrieval — no loop; classic RAG
  • Agentic RAG — loop over retrieval (decide if you have enough, fetch more) — see Context Engineering and GraphRAG (IBM Technology)
  • Multi-agent / sub-agents — loops within loops; one agent spawns others. The product instance is Claude Code Workflows / Ultracode: a planning agent fans out to hundreds of parallel sub-agents (per MYTHOS MYTHOS MYTHOS (Matthew Berman), 63–100+ at once on Fable 5)
  • Scheduled loops — /loop cron-style (Boris Cherny on Coding Is Solved (Sequoia AI Ascent)) — agentic loop wrapped in a recurring trigger
  • Outer goal-loops ("software factories") — wrap autonomous agents + parallel workflows in a loop that burns tokens toward a goal until reached. Berman frames loops (per Steinberger / Boris Cherny) as "the next abstraction layer above agentic engineering"; loops × workflows × Fable 5 is his "nobody understands what's coming" thesis — see MYTHOS MYTHOS MYTHOS (Matthew Berman) and How Loops Are Improving Work — Sunil's Research Brief
  • Auto-research loops — meta-loop layered over agentic loops; each "experiment" is one or more ReAct executions wrapped in a keep/revert + never-stop control structure against a fixed metric. See Build Self-Improving Claude Code Skills (Simon Scrapes) for a skill-layer instance with Binary Eval Assertions
  • Neuro-symbolic validation loop (Coyle) — the ReAct loop with two validation surfaces overlaid: Pydantic at the door (type-check tool-call inputs) and Ontology at the ledger (validate tool-call outputs against a domain reasoner before persisting). Corollary: agents should have no side effects until validated. See Why Agentic Systems Need Ontologies (Frank Coyle, AI Engineer) and Neuro-Symbolic AI. Distinct from LLM-as-judge because the ledger check is deterministic — the reasoner either derives the fact or it doesn't

Empirical design notes — what wins (MAC, June 2026)

Meta-Agent Challenge (Autonomous Agent Development Benchmark) ran 39 (model × domain × run) configurations and qualitatively analyzed the artifacts produced by frontier meta-agents. Top-performing agentic artifacts on SWE-Bench and Terminal-Bench were minimal ReAct-style loops over a small toolset, sharing three design choices:

  1. Prompt caching on API calls to minimize per-loop latency
  2. Pre-search warming from issue symbols to populate context before the first LLM invocation (cuts wasted loops)
  3. A singular verification nudge forcing the model to verify all requirements before terminating

Notably, no top reasoning artifact used tree search or planner-worker decomposition despite their prevalence in the literature. Reasoning winners converged on parallel sampling + majority voting + prompt diversification. The empirical answer to "elaborate scaffolding vs minimal loop" is, at least for current frontier models: minimal loop wins.

Failure modes

  • Compounding errors — one bad tool result feeds the next decision; in multi-agent setups, this gets bad fast (per Agentic AI in the Enterprise (Praveen Akkiraju, CXOTalk))
  • Tool selection wrong — agent picks curl for a JS-rendered page and starts reverse-engineering Next.js (see CLI vs MCP (IBM Technology))
  • Prompt injection — untrusted tool output (web page, email) carries instructions; agent treats them as legitimate

2026-06-13 — cross-references (where the loop runs, and who pays for it)

Three threads converging on the agentic loop's economics and deployment surface:

  • Edge / on-device inference. Apple's new Siri (Apple's New Siri Bets on Google Models (Economist)) runs the loop on-device on Apple silicon, keeping personal data on the handset and sidestepping data-centre spend — the loop doesn't have to live in a hyperscaler's data centre.
  • Agents-don't-need-seats economics. The SaaSpocalypse thesis (Fear of the SaaSpocalypse (Economist)) is the business-model consequence of this page's mechanism: once the loop does the work, per-seat SaaS pricing decouples from value and consumption/token pricing takes over.
  • Assisted → agentic demand shift. The move from a human-in-the-loop assisted model to autonomous agentic execution multiplies tokens burned per task — driving the token-scarcity pressure tracked in The New Dumbest Chart in AI (AI Daily Brief) and Token Maxing. More loop iterations per outcome is the demand side of the compute squeeze.

Sources