The Agentic Loop: Three loops in a trench coat

(bobbytables.io)

88 points | by btables 134 days ago

10 comments

  • philipwhiuk 134 days ago
    Aren't the loops the wrong way round in the diagram. The tightest loop is the inference loop, then the tool loop and then human loop?
    • DonHopkins 134 days ago
      You are absolutely correct. It's an i18n/l10n issue. They spin in the opposite direction in the other hemisphere.
    • btables 134 days ago
      I think of them from the outside in, so that's why I illustrated it that way.
      • NitpickLawyer 133 days ago
        Fascinating. I think it's the first time I've heard it put that way.

        For me it's more intuitive the other way around, as the "outer" loops increase in complexity (and can have additional separate loops running inside them). It also makes sense because you can always add more (meta) loops that way.

      • huflungdung 134 days ago
        [dead]
  • tptacek 133 days ago
    You can always find more loops if you want to write the next version of this post. Anything that runs software is a loop of instruction execution.
    • perching_aix 133 days ago
      The programming equivalent of "it's only a question of where did they hide the circle" in math? :)
  • swyx 134 days ago
    • jamestimmins 133 days ago
      The issue I have with loops is that for truly complex work, where I care about building a generalized solution for a complex problem, the agents frequently reward hack and end up burning indefinitely without finishing until I step in.

      Curious how you're addressing this

      • gwerbin 133 days ago
        Even with Claude Code and Opus I genuinely don't understand how people are actually doing productive things with these loops. Unmanaged by humans, these things go deep, deep into their own pits of internal domain language, depth-first development, and tail-chasing. The stuff that I've seen at work produced by people exploring these kinds of "meta loop" approaches typically have a high ratio of slop and fluff to useful code and documentation.

        (I haven't tried Fable yet, but people have been writing about this stuff long before Fable came out so that shouldn't count.)

        It makes sense for something like autoresearch because you're trying to exhaustively explore a space that would be impossible for a human to explore by hand. But for something like building the software to run a business, there's absolutely no way I would trust anything like this. It's ultimately just superpowered vibecoding, giving you the ability to churn out more slop faster, not build useful things faster.

        Show me one example of a successful application developed using this kind of meta-meta-loop architecture. Supposedly Claude Code itself is entirely AI generated code, but it's not a `while` loop, it still has a team of designers and developers.

        (Also this meta-loop stuff is different from the tactical-level Ralph Wiggum loop stuff. That's a strategy to make smaller/weaker LLMs perform like better LLMs, using say 5x more tokens but at 1/10 the cost per token so that the cost-benefit math works out.)

    • btables 133 days ago
      Totally. Earth's rotation is a loop too. We should count that.
      • ratelimitsteve 133 days ago
        rotation and orbit, and technically the eccentricity in the axis as well
        • monocasa 133 days ago
          There's also at least the galactic orbit. There might be a very large scale orbit as well around the Great Attractor, but the jury's still bery much out on that one.
          • lioeters 133 days ago
            Kinda getting dizzy thinking about all the loops we're embedded in. Where is the still point in these turning wheels of the world.
          • fragmede 133 days ago
            Don't forget the Big Bang to the Big Crunch, and then that looping as well.
  • otekengineering 133 days ago
    those are rookie numbers, my agent harness goes way more than 3 loops deep, and the depth dynamically ebbs and flows throughout the development process. like most brags, i'm being defensive over a personal tool that i know has ballooned way too big, but building a token-fueled katamari ball that rolls itself uphill has been a fun way to imagine Sisyphus happy.

    a harness is a chain connecting two other chains, the LLM and the human are themselves made up of loops within loops within loops.

  • bicepjai 133 days ago
    I like how you found the pattern of 3 loops. I am working on a similar blog where I had human loop outside the inference loop :) human -> llm-> tool
  • cheschire 133 days ago
    Anyone have suggestions on implementing loops with a basic $20/mo subscription to claude or gemini? Any blog posts recommended?
    • gexla 133 days ago
      The article is describing how every harness functions. If you're already using Codex, Claude Code, or Antigravity then you're already doing this. And you get a lot of usage. I generally don't hit my limits with GPT if I stick to reviews of code that cheaper models create. Google gives you a low number of free requests. OpenCode has a generous free tier for open source models (and a plan that is $5 / month for the first month.)
      • cheschire 133 days ago
        The article describes API calls using code. How does one use these loops in Claude Code (assuming you mean CLI not cloud) or Antigravity (assuming you mean agy not the IDE)?
        • solumunus 133 days ago
          The article is describing how agents work. You can either read it only to gain that understanding, or read it because you’re trying to build your own version of Claude Code. “How can we use these loops in Claude Code?” doesn’t make any sense.
          • cheschire 133 days ago
            Oh, interesting.

            So am I understanding correctly then that the tools that come with monthly subscriptions are inherently limited and unable to expand to what the article describes in the outermost loops?

            • gwerbin 133 days ago
              Depending on what kind of "loop" you're talking about, the answer is yes or no depending on the harness.

              For example Claude Code already has some relatively sophisticated features for managing automated loops of doing stuff (and really don't overcomplicate it -- a loop is just doing something over and over). And there's the meme of running `while true ; do claude < prompt.txt ; done` as your agentic coding framework. And there are also plugins for Claude Code such as https://claude.com/plugins/ralph-loop.

              So yes by default Claude Code doesn't include some kind of 5-layer meta-hyper-meta-looper thing. But that's not what the article is about anyway... it's just describing how agent harnesses work and how humans typically interact with them, without using that layered meta-looping stuff.

              • cheschire 132 days ago
                I must have taken the article too literally. Thanks for taking the time to help me understand.

                It’s also hard to tell what’s a joke these days surrounding a lot of AI “best practices” and what’s a legitimate idea worth exploring.

              • killix 132 days ago
                [flagged]
            • mpalmer 133 days ago
              You should just read more about this stuff and try using it.

              The high-level questions you are asking suggest you don't yet have a great base-level understanding of the concepts.

              • cheschire 132 days ago
                So going allllll the way back up to my original message where I asked for more resources to read… yeah I think you might be onto something.
            • solumunus 133 days ago
              Are you asking if it’s possible to add custom tools to CC/Codex which it can then use? If not, please clarify what you mean.
    • nickthegreek 133 days ago
      hermes agent
      • cheschire 133 days ago
        I appreciate you seeing through my confusion and giving me a concrete response.
  • argestes 133 days ago
    lack of syntax highlighting makes the article harder to read
  • jabenhaim 133 days ago
    [flagged]
  • draw_down 134 days ago
    [dead]