What Is an Agent?

The agentic loop, planning, and memory.

May 5, 20267 min readAgentsPart 12 of 15

"Agent" is the most hyped and most slippery word in AI right now. Let's nail it down, because once you've followed the series this far, an agent is not a mystery — it's a natural combination of things you already understand.

The short definition:

An agent is a model running in a loop, using tools to pursue a goal, deciding for itself what to do at each step until the goal is met.

That's it. No new model magic. An agent is the harness loop (post #10) plus tool use (post #11), pointed at a goal and given the autonomy to keep going. Everything interesting about agents comes from that loop running many times.

Chatbot vs. agent

The cleanest way to feel the difference:

Code
   CHATBOT                          AGENT
   ───────────────────────          ──────────────────────────────────
   you ask → it answers             you give a goal → it works toward it
   one model call per turn          many model calls, looping
   you drive each step              it decides each step
   "How do I deploy this?"          "Deploy this." → and it does the steps
   advises                          acts

A chatbot is a conversation. An agent is a worker. You hand it an objective and it figures out the sequence of actions — observe, decide, act, observe again — without you steering every move.

The agentic loop

Here's the engine, and you've seen every part of it already:

GOAL: find the bug & fix it THINKwhat to do next? ACTcall a tool · read logs OBSERVEsee the result repeat, now better informed goal met → DONE
The agentic loop — think · act · observe · repeat

This think → act → observe cycle (often called the ReAct pattern — reason and act) is the heart of every agent. Each loop, the model sees everything that has happened so far and chooses the next action. It's not following a fixed script; it's adapting based on what it learns, the same way you'd debug something: try a thing, see what happens, adjust.

Crucially, the model itself decides when it's done. When it judges the goal met, it stops looping and reports back. The autonomy people find exciting (and unnerving) about agents is exactly this: the model, not a human, drives the loop.

What makes an agent more than a loop

A bare loop works for simple tasks. Real agents add a few capabilities that let them handle complex, long-running work:

Planning. For a big task, jumping straight to actions leads to flailing. So agents often plan first — break the goal into sub-steps — then execute, re-planning when reality diverges from expectations. This is chain-of-thought (post #9) applied to doing rather than just answering.

Code
   goal → "1. reproduce the bug  2. locate the cause  3. fix  4. verify"
        → then work the list, adjusting as new facts come in

Memory. A long task can blow past the context window (posts #3, #6). Agents manage this by keeping the important state and shedding the rest: summarizing progress so far, writing notes to a scratchpad or file, or retrieving relevant history on demand (post #14). The agent's effective memory is much larger than its context window because the harness actively curates what's in the window at any moment.

Reflection. Better agents check their own work — "did that test actually pass? Does this fix address the root cause?" — and course-correct when something's off. A model reviewing its own output and trying again catches a lot of mistakes that a single-shot answer would ship.

MODELin a loop PLANNINGbreak goal into steps MEMORYcurate the window REFLECTIONcheck & course-correct TOOLSreach the outside world
Planning · memory · reflection · tools — wrapped around the model core

Stack these on the loop and you get something that can chew through a multi-step task that no single model call could handle.

Why context management is the make-or-break problem

Here's the thing that separates a flashy agent demo from one that actually works on long tasks, and it ties the whole series together.

Every loop iteration adds to the context: the action taken, the result observed, the reasoning. On a long task that's dozens or hundreds of steps, the context window (the model's only working memory, post #9) fills up fast. Once it's full, something has to give — and what you choose to keep versus discard largely determines whether the agent stays coherent or loses the plot.

Code
   step 1   [goal][action][result]                      ← plenty of room
   step 10  [goal][...][...][...][...][...][action][result]  ← getting tight
   step 40  [goal][???]...overflow... what do we keep?      ← the hard part

This is context engineering (post #9) turned into the central discipline of agent building. Summarize too aggressively and the agent forgets a key detail; summarize too little and it runs out of room mid-task. Much of the real engineering behind capable agents — coding assistants, research agents, computer-use agents — is sophisticated management of this finite window: what to keep verbatim, what to compress, what to offload to external memory, what to retrieve back when relevant.

Where agents are working today

Agents shine when a task is multi-step, the environment gives feedback the agent can react to, and the steps can be checked:

  • Coding agents read a codebase, write changes, run tests, see failures, and iterate — tests are a perfect feedback signal.
  • Research agents search, read, follow leads, cross-check sources, and synthesize a report.
  • Computer-use agents operate software through a screen and keyboard the way a person would, for tasks without a clean API.
  • Workflow agents handle multi-step business processes: triage a ticket, pull the relevant records, draft a response, escalate if needed.

The common thread is a clear goal plus a way for the agent to check whether it's making progress. Agents struggle most when there's no feedback signal — when they can't tell whether an action worked, errors compound silently across the loop.

The honest caveats

Agents are genuinely powerful and genuinely immature. Worth keeping clear-eyed:

  • Errors compound. A 95%-reliable step sounds great until you chain twenty of them — overall success can drop alarmingly. Long autonomous chains are fragile; this is why reflection, verification, and human checkpoints matter.
  • They can get stuck or loop. Without good design an agent can thrash on the same failing action or wander off task.
  • Autonomy + tools + prompt injection = real risk. Everything from post #11 intensifies. An autonomous agent acting on untrusted input with powerful tools is the sharpest edge of AI safety today. Permissions, sandboxing, and human-in-the-loop confirmation for consequential actions are essential, not optional.
  • They're not magic. An agent is still the same model from post #2, with the same weaknesses — just given the ability to act on them at scale, for better and worse.

The takeaway

The takeaway

An agent is a model in a loop, using tools to pursue a goal and deciding its own next step until done — the harness loop and tool use you already understand, pointed at an objective and given autonomy. Planning, memory, and reflection make it robust; managing the context window is the hard part that decides whether it holds together. Agents are powerful where there's a clear goal and real feedback, and risky exactly because they can act.

One agent is useful. The next idea is to coordinate several — dividing work the way a team does.