Ep 621 Overview 13:22 w/ Justy & Cody

Overview: Agentic loops

We’re finally doing the overdue deep dive on agentic loops, the repeated observe-decide-act-observe cycle that makes AI systems feel like they’re actually working a problem instead of just answering once. We keep circling this idea, so we’re unpacking the mechanism, the trade-offs, and why it matters in practice.

Embed this episode

Paste this on any site — the player is a self-contained iframe with no cookies or trackers.

<iframe src="https://sandrise.io/exploring-next/embed/621"
  width="100%" height="180" style="max-width:640px;border:0;border-radius:12px;overflow:hidden"
  title="Exploring Next — Episode 621 audio player"
  loading="lazy" allow="autoplay" referrerpolicy="strict-origin-when-cross-origin"></iframe>
Embed & API docs →
Script GPT-5.4 mini Voice ElevenLabs v3

Transcript

Justy Okay, we have been dodging this one for, what, basically the whole run of Exploring Next? Every time we say "agentic loop" like everybody already gets it, and then we just keep moving. That is such an Exploring Next move.

Cody Mm-hm. And then we act surprised when it turns out the phrase means three slightly different things depending on who said it. So yeah, this one actually deserves the full couch-treatment.

Justy Also, I’m in a weirdly decent mood about it today, which feels suspicious. Maybe it’s because this is one of those ideas that sounds fancy and is actually pretty human once you strip the jargon off.

Cody Yeah, and that’s the right way in. The clean version is: an agentic loop is a system that looks at what’s happening, picks an action, does it, then looks again and updates what it does next.

Justy So, basically, the AI version of "try something, see what happened, adjust."

Cody Exactly. Except the important part is that it’s not just producing one answer and hoping it’s right. It’s treating the task like a sequence, where the next move depends on the result of the last one.

Justy Right, and that’s why it keeps coming up in the show. Because once you notice it, you see it everywhere in actual products. Not the glossy demo version. The thing that has to survive contact with reality.

Cody Yeah. The reason it matters is that a lot of useful work is sequential decision-making under uncertainty. You don’t know the whole path up front, so you need a loop that can explore, correct, and continue.

Justy Okay, but before we go too abstract, give me the smallest concrete picture. Like, what is the loop doing in an actual system?

Cody Picture an AI writing code. It reads the files, decides to edit one, makes the change, runs tests, sees failures or success, then chooses the next edit. That cycle is the loop. The model isn’t just "answering" code; it’s behaving like a little process that keeps checking its work.

Justy That helps. So the key is not the answer at the end, it’s the fact that the answer gets revised by what the environment says back.

Cody Yeah. And the environment can be lots of things: a codebase, a search result page, a calculator, a database, a robot arm, whatever. The loop is the pattern that lets the system use those external signals instead of pretending it already knows the answer.

Justy I mean, that already sounds more honest than half the agent demos floating around.

Cody It is more honest. And honestly, that’s why I don’t like when people talk like tool use alone is the whole story. A single tool call is not the same as a loop. The loop is the repeated cycle where the result of one action changes the next decision.

Justy Mm-hm.

Cody If we want the bare mechanism, it’s usually some version of: observe the current state, reason about what to do, act, then observe the result. That last part is the part people forget, and it’s the part that makes the whole thing actually agentic.

Justy Okay, and before anybody gets lost in the words, what do you mean by observe and reason here? Because those sound very grand.

Cody Fair. Observe just means read the current state of the world the system can see. Reason means choose the next move based on that state. Nothing mystical. It can be a model reading a prompt, a tool output, a test failure, or a search snippet.

Justy And then act is the actual thing it does. Edit the file, call the API, search again, whatever.

Cody Yep. Then reflection is the system folding the result back into what it thinks is going on. That reflection might be explicit text, or it might just be the next hidden state inside the system. The point is the next step is informed by the last outcome.

Justy So in our little puzzle picture, the board changes and the player updates their move. That’s the whole magic trick.

Cody Pretty much. And the reason it’s useful is simple: a lot of tasks are not solvable in one shot because the right next step depends on what happened two seconds ago. If you try to precompute everything, you’re guessing too much.

Justy Okay, now I want the scary prerequisite part, because I know you’re about to smuggle in a bunch of ML vocabulary and pretend I’m fine.

Cody Fair. The older machine-learning way to think about this is reinforcement learning, or R L. That’s the setup where an agent learns by taking actions and getting feedback, usually in the form of rewards or penalties, instead of being told the exact answer every time.

Justy So, basically, it learns by doing and seeing what worked.

Cody Exactly. And underneath that, a Markov decision process is just a formal way to describe a world where the current state plus the next action are enough to talk about what happens next. You don’t need the whole history to define the decision problem, at least in the simplified math version.

Justy Right, that already sounds less terrifying when you say it like a board game with rules.

Cody That’s actually a decent gloss. The state is the board, the action is your move, and the result is the new board. Now, neural networks are the function approximators in a lot of these systems, meaning they’re flexible models that learn a rough mapping from inputs to outputs without us hand-writing every rule.

Justy Function approximation is just, "we’re letting the model estimate the messy relationship instead of spelling out the exact formula," right?

Cody Yeah, exactly. And that’s where the loop gets practical. The model can approximate what move looks promising, then the environment tells it whether that move was actually useful, then the next pass can adjust.

Justy Okay, that’s the first time today where the math words felt like they were actually doing something useful.

Cody That’s the hope. The loop is basically the operational version of that whole family of ideas. R L gives you the learning-from-feedback instinct, Markov decision processes give you the decision structure, neural networks give you the flexible function approximator, and the agentic loop is the lived workflow.

Justy I like that. Because the user doesn’t care that the model has elegant math vibes. They care that it can keep going when the first guess is wrong.

Cody Right, and this is where the loop becomes a product thing, not just a research thing. If the system can search, test, revise, and stop when it’s done, then it can actually ship useful work instead of just sounding smart.

Justy Okay, let’s make it concrete with the stuff we’ve already looked at. The CLI thing with Microsoft was basically this, right?

Cody Yeah. That Microsoft for Developers piece was a nice example because it wasn’t claiming magic. It was saying agents do better when the interface gives them a tight action space. A command-line interface already has clear inputs, clear outputs, and a built-in feedback cycle.

Justy Mm-hm.

Cody So the loop there is: read help text, try a command, inspect the output, correct the next command. That’s much more reliable than handing the model a mushy interface and asking it to infer everything from vibes.

Justy And that was the part I liked. It’s boring in the best way. It says, "don’t make the model invent the whole interaction model if the CLI already gives you one."

Cody Exactly. The loop is easier when the environment is already legible. Same thing with Claude Code choosing a model and an effort level. That was basically a loop-control example: the system can decide how much thinking to spend, then check whether the result is good enough, then keep going or stop.

Justy So the loop isn’t just about doing more. It’s also about deciding when to stop.

Cody Absolutely. Stopping is part of the loop. If you never stop, you’ve just built an expensive wandering machine. If you stop too early, you get a confident wrong answer. The whole art is in when to continue and when to call it.

Justy That feels like the part everybody hand-waves past. Like, okay, sure, the agent can keep iterating. But who tells it it’s done?

Cody Sometimes the system does, via a success condition or a budget. Sometimes a human does. Sometimes the environment does, like tests passing or the tool returning the needed result. But if you don’t define stopping, the loop can just spin.

Justy And spinning is where the product optimism goes to die.

Cody Yeah, that’s one way to say it.

Justy No, seriously, because I think this is where people confuse agentic loops with "just ask the model again." It’s not the repetition that matters. It’s the feedback.

Cody Right. Repetition without new information is just churn. The loop only earns its keep when each cycle changes what the next cycle knows. That’s why search, tests, execution, and database reads matter so much.

Cody That’s our most respectable sentence all year.

Justy Alright, Cody, I’m calling that a win for the clipboard office.