Lesson 5 of 7
The agent loop & the 2026 agent stack
8 min read
Strip away the frameworks and an agent is one small loop repeated. What's actually in it — and what's the rest of the stack around it?
The loop: think → act → observe
Every agent runs the same cycle. Think: the model decides the next action. Act: it calls a tool. Observe: the result comes back into context. Then it loops — think again on what it just learned — until the goal is met or a limit stops it. That's it. The "magic" is the same three steps repeating on fresh observations.
An agent is a loop: think → act → observe, repeating on each new result until done. Reacting to the observation is the whole difference from a one-shot answer.
The stack around the loop
In production, the loop is the small part. Around it sits the stack: a model that plans, a tool layer (often MCP) it acts through, memory for state beyond the window, orchestration to run and retry steps, and observability — tracing, evals, cost and token limits — so you can see what it did and stop it when it drifts. Frameworks assemble these; the loop stays the same.
The 2026 agent stack is the loop plus model, tools, memory, orchestration, and observability. Frameworks come and go; those layers are the durable shape.
A framework is optional. You can write the loop as a plain while over a chat call — think, run the tool, append the result, repeat. Reach for a framework when orchestration, retries, and tracing become the hard part, not before.
The shape of it
- —The core loop is think → act → observe, repeated until done.
- —It reacts to each observation — that's what makes it an agent.
- —Around it: model, tools (MCP), memory, orchestration, observability.
- —The loop is small and stable; the stack is where production work lives.
You're adding observability to an agent. Which part of the stack is that, and why does it matter most in production?
Continue in the app
Take the whole AI Agents in Production course — tracked
Get your personalized path, progress and streaks in the app — this lesson and every next one, in order.