The Agentic Loop — Three Loops in a Trench Coat

Source: HN, bobbytables.io (Robert Ross, 2026-07-14) HN Discussion: https://news.ycombinator.com/item?id=48907672 Original: https://www.bobbytables.io/p/the-agentic-loop-three-loops-in-a

Summary

Agent systems are composed of three nested loops:

  1. Inference Loop — Makes chat completion API calls, manages conversation history, delegates tool calls
  2. Tool Loop — Handles tool execution, injects results back into chat history, manages tool_call_id correlation
  3. Human Loop — Approval/denial/steering for tool calls, the hardest part because it blocks indefinitely

Key Insights

  • Tool calls are inferred text → hallucination risk for tool names and parameters
  • Tool results must include tool_call_id for provider API compatibility
  • Anthropic’s API has dedicated is_error field; OpenAI relies on content-based error signals
  • Streaming complicates the loop structure but doesn’t change its fundamental shape
  • The Human Loop requires durable execution frameworks (e.g., Temporal) because it can block for hours

Relevance to Hermes Agent

  • Hermes’ conversation loop → Inference Loop
  • Tool execution (terminal, write_file, etc.) → Tool Loop
  • pre-exec-guard, tool-guard, verification-before-completion → Human Loop
  • The three-loop model validates Hermes’ architecture and provides vocabulary for discussing it