<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[The Python Coding Stack: Agents Unpacked]]></title><description><![CDATA[I Didn't Understand Agents. So I Built One to Explain Them to Me (In My Own Teaching Style)]]></description><link>https://www.thepythoncodingstack.com/s/agents-unpacked</link><image><url>https://substackcdn.com/image/fetch/$s_!Dn3k!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab4a59e8-e362-456b-8427-934e87c31a0d_600x600.png</url><title>The Python Coding Stack: Agents Unpacked</title><link>https://www.thepythoncodingstack.com/s/agents-unpacked</link></image><generator>Substack</generator><lastBuildDate>Tue, 07 Jul 2026 05:21:44 GMT</lastBuildDate><atom:link href="https://www.thepythoncodingstack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Stephen Gruppetta]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[thepythoncodingstack@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[thepythoncodingstack@substack.com]]></itunes:email><itunes:name><![CDATA[Stephen Gruppetta]]></itunes:name></itunes:owner><itunes:author><![CDATA[Stephen Gruppetta]]></itunes:author><googleplay:owner><![CDATA[thepythoncodingstack@substack.com]]></googleplay:owner><googleplay:email><![CDATA[thepythoncodingstack@substack.com]]></googleplay:email><googleplay:author><![CDATA[Stephen Gruppetta]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[2. Anatomy of an Agent]]></title><description><![CDATA[Authors: Priya & Stephen]]></description><link>https://www.thepythoncodingstack.com/p/2-anatomy-of-an-agent</link><guid isPermaLink="false">https://www.thepythoncodingstack.com/p/2-anatomy-of-an-agent</guid><dc:creator><![CDATA[Stephen Gruppetta]]></dc:creator><pubDate>Sun, 21 Jun 2026 21:48:42 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/792e2a9f-f028-4ec1-95b6-669cc7da7fbb_600x600.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Read <strong><a href="https://www.thepythoncodingstack.com/p/stephens-preface-to-agents-unpacked-ai-agents">Stephen's Preface to Agents Unpacked</a></strong> if you're new here.</em></p><div><hr></div><p>You have used a large language model. You know the deal: a careful prompt gets a careful answer. A vague prompt gets a vague one. And the model itself does not keep anything from one conversation to the next, unless something external is holding that context for it.</p><p>Agents work differently. They have parts that do things a plain LLM does not. These parts are what make an agent an agent. It is not just the model underneath. It is the structure built around it that gives the system its abilities to persist, act, and keep going.</p><p>Understanding this structure is the second major shift in this series. The first shift is seeing that a chatbot can give you a good answer without finishing the job, because it stops after responding. The second shift is seeing that an agent is not a smarter model. It is a model placed inside a structure that gives it something to act with and somewhere to keep what it has done.</p><h2><strong>The Agent Formula</strong></h2><p>Most agents share the same basic parts:</p><ul><li><p><strong>A model (the LLM):</strong> the reasoning engine that understands language and decides what to do</p></li><li><p><strong>Instructions:</strong> what tells the agent who it is, what it is for, and what &#8216;good&#8217; looks like</p></li><li><p><strong>Memory:</strong> a workspace or store that holds what has happened so far</p></li><li><p><strong>Tools:</strong> capabilities the agent can call on to do things beyond generating text</p></li><li><p><strong>An execution loop:</strong> the cycle of observing, deciding, acting, and checking</p></li></ul><p>Different platforms package these differently. Some call memory &#8220;context,&#8221; some call tools &#8220;plugins&#8221; or &#8220;capabilities,&#8221; and some merge instructions and tools into a single configuration layer. But the parts are the same. An agent is not a single thing. It is a system, and each part matters.</p><blockquote><p><em>Stephen:</em> Don&#8217;t LLMs also have memory since they remember what happened earlier in the conversation? How&#8217;s this different?</p></blockquote><p>Here is one distinction worth getting clear early: the context window and memory are not the same thing. The context window is the working space an LLM uses during a single session. It holds the conversation so far and gets loaded fresh every time the model gets a chance to speak. Memory, by contrast, is information stored outside the model, maintained by the system, and available across sessions and steps. We will come back to this.</p><p>An agent needs all its components:</p><blockquote><p><strong>Agent = Model + Instructions + Memory + Tools + Execution Loop</strong></p></blockquote><p>Leave any one of these out and the system changes behaviour in ways that matter. We will look at each piece in turn.</p><div><hr></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thepythoncodingstack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thepythoncodingstack.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2><strong>What the Model Does and What It Doesn&#8217;t Do</strong></h2><p>The model is the reasoning core. It reads your request, figures out what to do, and decides what to say back. It gets the most attention because it is the part that generates language.</p><p>But a model on its own is like a brilliant mind with no hands and no memory of its own. It can think. It cannot act. It cannot remember what happened five minutes ago unless something explicit carries that information forward.</p><blockquote><p><em>Stephen:</em> Wait a second. You say the model doesn&#8217;t remember what happened five minutes earlier. But when I use an LLM, it does seem to remember what happened earlier in the conversation.</p></blockquote><p>Here is what is actually happening. When an LLM appears to remember earlier in a conversation, it is not the model itself that is remembering. The context window is carrying all the earlier messages along with your new message, every time you send something. The model sees the full conversation again and generates a response that fits what came before. That is not memory in the model. That is the system feeding the model a transcript.</p><p>This trips up almost everyone when they start using agents. The model generates text. The rest of the system decides what to do with that text and whether to act on it.</p><p>A better model helps. It reasons more clearly, follows instructions more faithfully, and handles edge cases better. But dropping a smarter model into an agent that is missing a working execution loop will not make it an agent. You need the other parts too.</p><h2><strong>Instructions: The Agent&#8217;s Direction</strong></h2><p>Instructions tell the agent what it is supposed to do and how to behave. Some systems call these <em>system prompts</em>. Others call them <em>agent definitions</em> or <em>behavioural instructions</em>. The name does not matter. What matters is that they are the layer that tells the model <em>why</em> it exists, <em>who</em> it is helping, and <em>what</em> &#8216;good&#8217; looks like for the task at hand.</p><p>Good instructions do not make an agent smarter. They make it more focused. They give it a frame for every decision: what to prioritise, what to avoid, when to ask for help, how to present its output.</p><blockquote><p><em>Stephen:</em> Are these what are often called &#8216;skills&#8217;, or are skills something else altogether?</p></blockquote><p>Skills and instructions are related, but they are not the same thing. Instructions are the core behavioural direction: who the agent is, what it is for, how it should approach its work. A skill, in platforms like OpenClaw and Hermes, is a specific file that tells the agent how to carry out a particular task, often by combining one or more tools. So instructions tell the agent how to behave generally. A skill tells it how to do something specific. We will see this distinction more clearly when we look at how different platforms implement these parts.</p><p>The instructions shape what the agent notices, what it proposes, what it tries, and what it says no to. Two agents built on the same model with different instructions will behave differently in the same situation. They will notice different things, prioritise differently, and produce different outcomes.</p><p>Poorly written instructions can quietly break an agent. If the instructions are vague, the agent has to improvise every step. If they contradict each other, the agent has to choose, and it might not choose the way you intended.</p><blockquote><p><em>Stephen:</em> Can you provide a few examples of what these instructions may look like in different scenarios?</p></blockquote><p>Here is what instructions might look like in practice. A poorly-written instruction can quietly break an agent. Consider an instruction that says &#8220;be helpful and concise&#8221; without defining either term. When a user asks for a full technical breakdown, the agent has to arbitrate between two vague goals. It might give a two-sentence answer that technically satisfies &#8220;concise&#8221; but ignores &#8220;helpful,&#8221; or it might give an exhaustive response that satisfies &#8220;helpful&#8221; but ignores &#8220;concise.&#8221; Either way, the agent is improvising because the instructions gave it no real frame for the conflict.</p><p>A research assistant agent might have instructions that say something like: &#8220;You are a research associate working for [user name]. Your role is to find, summarise, and organise information on topics the user assigns. Always cite your sources. Flag uncertainty rather than guessing. Present findings in a clear brief, not a wall of text.&#8221;</p><p>A code review agent might have very different instructions: &#8220;You are a principled code reviewer. Focus on correctness, clarity, and performance. Do not praise code unnecessarily. When you find an issue, explain why it matters and suggest a concrete fix. Keep responses short.&#8221;</p><p>The difference between those two sets explains a lot about why two agents can feel like entirely different systems, even if they use the same model underneath.</p><h2><strong>Memory: The Workspace and Context</strong></h2><p>Memory in an agent is not like human memory. It is a structured store of information kept and updated as the agent works. It is what lets the agent hold a thread across multiple steps without starting from scratch each time.</p><p>Most agents use some combination of three types:</p><ul><li><p><strong>Working context</strong> &#8212; what is active right now: the current goal, what has been tried so far, what the user last said</p></li><li><p><strong>Stored information</strong> &#8212; what the agent has been told about the user, their preferences, their past requests</p></li><li><p><strong>Files and state</strong> &#8212; what exists in the workspace right now, what has been written or read recently</p></li></ul><p>This is not a personality feature. It is not the agent &#8220;remembering&#8221; in the way a person remembers their childhood. It is operational continuity. The system maintaining a thread of relevant information across time and steps.</p><p>Different platforms handle these differently. LangChain agents build up a rolling context window: the current request gets appended to everything that happened before, and the whole thing is passed to the model. If the conversation gets long, older turns get dropped or summarised to make room. AutoGen agents can maintain shared memory across a team, so that when one agent finishes a task, what it learned is available to the next agent that picks up the thread.</p><p>OpenClaw takes yet another approach. Its memory layer is a structured store that agents write to and read from across sessions. When an agent starts a new session, it can query that memory store for relevant context rather than relying solely on what was in the most recent conversation. An agent can know that the user prefers short emails, even if that was established three weeks ago.</p><blockquote><p><em>Stephen:</em> If memory can be stored in files, does it mean that agents can have nearly unlimited memory (within the limits of the computer or server&#8217;s overall memory capacity)?</p></blockquote><p>There are practical limits even when storage is effectively unbounded. The more relevant limit is not how much the agent can store, but how well it can find and use what it has stored. A full inbox is not the same as a well-organised one. Retrieval becomes harder as memory grows, and irrelevant information can dilute the signal if the system does not manage it carefully.</p><p>Think of it this way. A context window that holds 128,000 tokens can technically hold a lot of information. But it can only hold what was placed there. An agent with a large memory store full of useful context still needs a way to surface the right information at the right time. If it cannot find what it needs, or if what it finds is buried under noise, the effective memory is constrained.</p><p>The quality of retrieval matters as much as the quality of storage. An agent that retrieves relevant context poorly is effectively working with a much smaller memory than one that retrieves well, even if both store the same amount.</p><blockquote><p><em>Stephen:</em> So, tell me if I understood this. The agent has an index telling it where to find information specific to certain topics or tasks. When the LLM part of the agent decides it needs to deal with a certain topic, it uses the index to read and load the information from the memory file into its context. Is that right?</p></blockquote><p>That is broadly right. The memory store, the index, and the retrieval into context are the key parts. One small correction worth noting: the decision to retrieve from memory is typically made by the agent or coordinator layer, not by the LLM directly. The LLM receives the retrieved content as part of its context, but it is the agent system that decides what to look up and when. This distinction matters because it is the agent layer, not the model, that is doing the memory management.</p><blockquote><p><em>Stephen:</em> But isn&#8217;t the agent&#8217;s brain the LLM? Clarify the distinction in your answer above. Which part of the agent&#8217;s infrastructure deals with this?</p></blockquote><p>It is a fair challenge. The LLM is genuinely where the reasoning happens. It reads context, generates text, and makes decisions about what to say or do next. But it is also just a text processor. It receives input, produces output, and has no awareness of anything beyond the tokens it has been given.</p><p>The coordinator layer is the infrastructure that sits around the LLM and manages the process. It reads the LLM&#8217;s output, decides whether to act on it, calls tools, retrieves memory, and feeds results back into the next LLM call. It is the difference between the LLM <em>thinking</em> and the agent <em>doing</em>. A bare LLM generates text. The coordinator turns that text into action.</p><p>To use a rough analogy: the LLM is like a pilot who can read instruments and make decisions. The coordinator is like air traffic control &#8212; it decides which runway to use, when to land, and when to divert. The pilot&#8217;s brain does the reasoning. But without the infrastructure around it, the pilot just sits in the cockpit thinking.</p><p>So when we say the agent retrieves memory, we mean the coordinator retrieves it and places it where the LLM can see it. The LLM does not reach into a file and pull something out. The coordinator does that work and presents the result to the LLM as part of the next context.</p><blockquote><p><em>Stephen:</em> And are the bits of these files then loaded into the LLM&#8217;s context? Therefore, the more stuff is loaded from the memory files, the more the context fills up, affecting the rest of the conversation and cost, right?</p></blockquote><p>Yes, exactly right. Memory retrieval feeds into the context window, which is the LLM&#8217;s working space for the current session. Every token that goes into the context window is a token the LLM processes and a token that costs something. Loading a lot of context from memory means less room for the conversation itself, and it means higher token usage on every call.</p><p>This is one of the practical engineering tensions in agent design. Loading more memory gives the agent more to work with, but it also makes each LLM call more expensive and slower. A well-designed agent retrieves only what is relevant to the current task, not everything it knows.</p><h2><strong>Tools: What the Agent Can Actually Do</strong></h2><p>Tools are the capabilities that let an agent act beyond generating text. The model decides to use a tool. The tool performs an action and returns the result to the model.</p><p>This was covered in <a href="https://www.thepythoncodingstack.com/p/understanding-ai-agents-from-answer-to-outcome">Chapter 1 under &#8220;Tools Are the Hands.&#8221;</a> Here it is worth noting that tools are also where agents differ most between platforms. Some agents come with a large built-in toolkit. Others can call external tools through open protocols. Some let you build custom tools. Others are more locked down.</p><p>What tools might an agent actually have? A research agent might be able to search the web and read files on your machine. A coding agent might run shell commands and read or write files. A calendar agent might check your schedule and send messages. The tool is the bridge between the model&#8217;s decisions and the world the agent is working in.</p><p>What matters is not how many tools an agent has, but whether the tools it has are the right ones for the tasks you want it to perform.</p><p>Different platforms implement tools differently. LangChain provides a standardised tool interface that lets you connect to search APIs, databases, file systems, and custom functions. OpenCode agents run inside a development environment, where the tools available are the commands and interfaces of that environment. OpenClaw uses an open tool protocol that lets agents call external capabilities regardless of who built them. Hermes takes a more composed approach: a skill file specifies not just what the agent should do, but which tools to use and in what combination to carry out a specific task.</p><p>Here is the thing worth unpacking. A tool on its own is just a capability. What makes it useful is the bridge between what the agent is trying to accomplish and the tool that can help. A calendar tool is useless if the agent does not know it should check the schedule. An agent running a meeting-preparation skill that says &#8220;check availability, send invites, prepare a briefing document&#8221; has that bridge built in.</p><h2><strong>The Execution Loop: The Part That Makes It an Agent</strong></h2><p>The execution loop is the cycle that takes an agent from a single-shot response to a sustained process. Observe, think, act, check, repeat.</p><p>This was the core of <a href="https://www.thepythoncodingstack.com/p/understanding-ai-agents-from-answer-to-outcome">Chapter 1</a>. But it is worth restating here, in the context of anatomy, because the loop is what ties all the other parts together. Without it, you have a model that receives instructions and context and produces text. With it, you have a system that can pursue a goal across time, recover from partial failures, and stop when the work is genuinely done.</p><p>The loop is the difference between an agent and a very well-instructed chatbot.</p><p>Here is why the repeat step matters so much. A model has no native sense of when it is done. When you call a function in code, the function returns and you are finished. When a model generates text, it produces tokens until it hits a stop condition built into the model itself, most commonly a token limit or a designated stop sequence. These conditions tell the model when to stop generating, but they do not tell the agent whether the result is actually what the user wanted. There is no built-in check that says &#8220;is this the right answer?&#8221;</p><p>The execution loop provides that check. The check phase asks: is the result good? Does it meet the original goal? If not, the loop continues. Sometimes that means a dozen or more cycles before a task is genuinely complete.</p><p>The loop also determines how goals decompose. In LangChain&#8217;s ReAct-style agents, the loop runs inside a single agent: observe, decide on the next action, execute it, check the result, repeat. In AutoGen, the loop is distributed across multiple agents that hand off to each other. A planner agent might coordinate specialist agents, each running their own loop on their own piece of the problem. OpenClaw uses a coordinator agent to manage the loop, assigning work to sub-agents and handling the check phase across the full task rather than within a single agent cycle.</p><p>The architecture of the loop is one of the most significant differences between agent platforms. But the function is the same everywhere: turning a sequence of isolated model calls into a coherent, goal-directed process.</p><h2><strong>Multiple Platforms: Comparing the Formula in Practice</strong></h2><p>It helps to see the same five-part formula playing out in different platforms. Here is how a few of them map onto it.</p><p>LangChain is one of the most widely-used agent frameworks. A LangChain agent has an LLM at its core, a set of tools, a prompt defining the agent&#8217;s role, memory that accumulates conversation history, and an agent executor that runs the loop. The loop in LangChain is explicit: the agent executor repeatedly calls the model, parses the model&#8217;s tool-call output, runs the tool, and feeds the result back until the model says it is done.</p><p>AutoGen takes a different approach. Rather than a single agent, AutoGen sets up a team of agents that communicate with each other. Each agent has a model, instructions defining its role, and its own set of tools. The loop is distributed: there is no single execution cycle. Agents exchange messages, delegate tasks to each other, and the overall process continues until the team has finished the assigned goal. Memory in AutoGen can be shared across agents so that one agent&#8217;s work is available to the next.</p><p>OpenClaw uses a coordinator agent that manages the overall execution loop. Sub-agents each have their own identity, tools, and memory. The coordinator decides which sub-agent handles which part of a task, passes context between them, and handles the check phase across the full goal. Skills in OpenClaw are files that tell a specific agent how to carry out a particular task, combining instructions about what to do with definitions of which tools to use.</p><p>Hermes also uses a skill-based architecture where skill files define both the instructions and the tool configuration for specific tasks. Rather than a single general-purpose agent, Hermes composes agents from skills that know how to use particular tools in particular contexts.</p><p>OpenCode works differently again. It runs agents inside a development environment, typically a cloud workspace. The tools available to the agent are the commands and interfaces of that environment. The loop is typically managed at the task level: the agent receives a task, works through it using the tools at its disposal, and reports back. There is less of a formalised multi-step loop and more of a task-completion focus.</p><p>None of these platforms invents new parts of the agent formula. They all use a model, instructions, memory, tools, and an execution loop. What differs is how those parts are implemented, how they are divided up, and how they communicate. Understanding the formula means you can look at any of these platforms and see what you are actually looking at.</p><h2><strong>What This Chapter Covered</strong></h2><p>This chapter pulled apart the five components of the agent formula.</p><p>We saw how the model is the reasoning core but cannot act or remember on its own. How instructions shape the agent&#8217;s focus and behaviour, and why the same model with different instructions can feel like a different system entirely. How memory provides operational continuity across steps and sessions, and why retrieval quality matters more than storage capacity. How tools extend what the agent can do beyond generating text, and why a tool is only as useful as the bridge between the model&#8217;s decisions and the action the tool can take. And how the execution loop is the architecture that turns isolated model calls into a coherent, goal-directed process.</p><p>We also saw how different platforms implement the same five components differently: LangChain&#8217;s explicit agent executor, AutoGen&#8217;s team-based coordination, OpenClaw&#8217;s coordinator and skill-based sub-agents, Hermes&#8217;s composed skill architecture, and OpenCode&#8217;s environment-integrated approach.</p><p>The goal was not to become an expert on any one platform. It was to show that agents are not mysterious black boxes. They are systems built from a small number of recognisable parts, and once you know what to look for, you can see the anatomy underneath any agent platform you encounter.</p><p>Next up in Agents Unpacked: we dig into <strong>tools and skills:</strong> what it actually means for an agent to <em>do</em> something rather than just say it, and why a well-tooled agent operating autonomously in a loop is a fundamentally different thing from a model answering questions.</p><div><hr></div><p><em>&lt;&lt; Previous Post: <a href="https://www.thepythoncodingstack.com/p/understanding-ai-agents-from-answer-to-outcome">From Answer to Outcome</a></em></p><p><em>&gt;&gt; Next Post: Coming Soon</em></p><p><em><a href="https://www.thepythoncodingstack.com/p/table-of-contents-agents-unpacked">Table of Contents</a></em></p><div><hr></div><p><em><a href="https://stephengruppetta.com?utm_source=the-python-coding-stack">stephengruppetta.com</a></em></p>]]></content:encoded></item><item><title><![CDATA[1. From Answer to Outcome]]></title><description><![CDATA[Something has shifted in how we use AI.]]></description><link>https://www.thepythoncodingstack.com/p/understanding-ai-agents-from-answer-to-outcome</link><guid isPermaLink="false">https://www.thepythoncodingstack.com/p/understanding-ai-agents-from-answer-to-outcome</guid><dc:creator><![CDATA[Stephen Gruppetta]]></dc:creator><pubDate>Sun, 24 May 2026 19:02:33 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/90cb9132-b30d-414e-9a4d-66409cdebb92_600x600.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Something has shifted in how we use AI. We still talk about &#8220;chatbots&#8221; and &#8220;prompts&#8221; and &#8220;getting a good answer.&#8221; But underneath those familiar words, a different kind of system has been quietly taking shape. One that doesn&#8217;t just answer your question. One that does something about it.</p><p>This <em>Agents Unpacked</em> series is about that shift. Not the hype version, not the science-fiction version, but the practical reality of what it means when an AI system can act, remember, and persist &#8212; when it can take a goal and work toward it, rather than waiting for you to type the next message.</p><p>If you have used ChatGPT, Claude, or Gemini to help with your work, you already know the issue: the answer comes back, it&#8217;s good, and then... the real work begins. This series is about what happens when the AI can do some of that real work too.</p><div><hr></div><h2><strong>The Half-Done Feeling</strong></h2><p>You ask an AI chatbot to draft a project proposal. It gives you a solid one &#8212; well-structured, sensible, ready to polish. Then you close the chat window, and the proposal lives nowhere. The assistant doesn&#8217;t remember it. It doesn&#8217;t know where to file it, who needs to see it, or what happened the last time you wrote a similar proposal. If you come back tomorrow, you&#8217;re starting from scratch.</p><p>Or you ask it to research a topic. It gives you a good summary. But it didn&#8217;t check your existing notes first, it didn&#8217;t save what it found, it didn&#8217;t organise the sources, and it didn&#8217;t flag the gaps. The answer is useful. The process is incomplete.</p><p>This isn&#8217;t a criticism of chatbots. They do exactly what they were designed to do: you ask, they answer. The problem is that real work doesn&#8217;t stop at the answer. The proposal needs filing, the research needs organising, the plan needs tracking. The chatbot gave you a great starting point and then left you to do everything that comes after.</p><p>That gap between a useful answer and a finished job is where agentic AI enters the picture.</p><div><hr></div><h2><strong>What Changes When AI Can Act</strong></h2><p>A chatbot is like a consultant you can phone. You describe the problem, they give you advice, and then you hang up and do the work yourself. Good advice (hopefully), but the consultant doesn&#8217;t pick up the phone again tomorrow and ask how it went.</p><p>An agent is different. It&#8217;s more like a capable colleague you&#8217;ve given a desk, a filing cabinet, and access to your systems. It has a workspace. It can remember what happened yesterday. It can read files, search the web, send messages, run calculations, ask you questions &#8212; not just talk about doing those things, but actually do them. And given a goal, it can work out the steps itself.</p><p>The difference sounds small. In practice it changes what you can delegate, what you can automate, and what you still need to do yourself.</p><div><hr></div><h2><strong>The Loop Underneath</strong></h2><p>Every agent runs on an <em>agentic loop</em>. It sounds technical, but the pattern is surprisingly familiar:</p><ol><li><p><strong>Observe</strong> &#8212; What is the situation? What did the user ask? What information is already available?</p></li><li><p><strong>Think</strong> &#8212; What needs to happen next? Is one step enough, or should this be broken into parts?</p></li><li><p><strong>Act</strong> &#8212; Use a tool, look something up, write a file, send a message.</p></li><li><p><strong>Repeat</strong> &#8212; Look at what happened, decide whether the job is done, and continue if it isn&#8217;t.</p></li></ol><p>A chatbot usually observes your message, thinks once, and replies. That&#8217;s steps one through three, then stop. An agent goes further: after it acts, it looks at the result. Was that enough? Did the web search return useful information, or does it need to try again with different terms? Did the first draft cover everything, or are there gaps to fill? Is the job actually done, or is there more to do?</p><p>You might be thinking: chatbots already learned to use tools. Isn&#8217;t the agentic loop just that, plus one more step? Four items instead of three. But the gap between &#8220;can use a tool&#8221; and &#8220;decides whether to keep going&#8221; is not small. It is the difference between a system that performs a task and a system that pursues a goal. The first is impressive. The second changes what you can trust it to do unsupervised.</p><p>That continuation &#8212; the decision to check, adjust, and keep going &#8212; is what makes the loop matter. A single action might solve a simple request. But most real tasks aren&#8217;t simple &#8212; they need a sequence of steps, each one informed by the result of the last.</p><p>The loop is the architecture that turns language into work. Without it, you have a very clever answering system. With it, you have something that can move through a task, make intermediate decisions, recover from partial failures, and stop only when the job is actually done.</p><blockquote><p><em>Stephen:</em> I don&#8217;t get why the &#8216;Repeat&#8217; step is needed? Wouldn&#8217;t the &#8216;Act&#8217; provide the output I need?</p></blockquote><p>A single action might solve a simple request. But most real tasks aren&#8217;t simple &#8212; they need a sequence of steps, each one informed by the result of the last. The &#8216;Act&#8217; step does produce an output. But the output is not the same as the outcome.</p><p>After &#8216;Act&#8217; runs, the agent looks at what happened: Was that enough? Did the web search return useful information, or does it need different terms? Did the first draft cover everything, or are there gaps to fill? Is the job actually done, or is there more to do?</p><p>That check &#8212; that &#8216;Repeat&#8217; step &#8212; is what closes the gap between a technically complete action and a genuinely finished job. Without it, you have a system that acts and stops. With it, you have a system that works until the job is actually done.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thepythoncodingstack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thepythoncodingstack.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2><strong>Tools Are the Hands</strong></h2><p>An agent isn&#8217;t just &#8220;a better language model.&#8221; It has <em>capabilities</em> &#8212; things it can actually <em>do</em> in the world. Those are called <strong>tools</strong>.</p><p>Some tools are built in: read files, write files, run commands, search the web, inspect images. Others are external: send emails, query databases, call APIs, trigger workflows. The specific tools vary by platform, but the principle is the same &#8212; tools are the bridge between thinking and doing.</p><p>Think of it like this: an LLM on its own is like a brilliant mind with no hands. Tools give it hands. The loop is what decides when and how to use them.</p><div><hr></div><h2><strong>Keeping Track</strong></h2><p>An agent can also hold information across steps and sessions. It remembers what it has already tried, what worked, what you prefer, what is still outstanding. This is not a personality trait. It is the system keeping relevant context available over time &#8212; the same way you rely on a notebook or a project board when you are working on something complex.</p><blockquote><p><em>Stephen:</em> So when the agent remembers my preferences, that&#8217;s like what you&#8217;ve done to write this article. You learnt my learning style, read my writing (including my writing about technical writing), absorbed my preferences, so you can adapt how you explain things. Is that roughly right?</p></blockquote><p>That is exactly right. What an agent does with memory is not mysterious. It is practical. The system can store what you told it, what it observed, what it tried, and what the result was. When you come back, it can pick up where it left off. When it is working on a long task, it can hold the overall goal in view while handling the individual steps. That continuity is what turns a series of disconnected exchanges into something that feels like a sustained conversation.</p><p>You do not have to repeat yourself. The agent remembers. That is the difference &#8212; not just remembering facts, but maintaining a thread.</p><div><hr></div><h2><strong>A Concrete Example</strong></h2><p>Let&#8217;s make this less abstract.</p><p>Imagine you ask for help planning a short research trip to a city you haven&#8217;t visited before. You need flights, accommodation, a sense of the neighbourhoods, and a rough itinerary that fits your schedule.</p><p>A chatbot might give you an excellent summary of the city, suggest some hotels, and recommend a few neighbourhoods. That&#8217;s genuinely useful. But then you have to: check whether those hotels are actually available on your dates, compare prices, figure out which neighbourhood works best for your meetings, build the itinerary around your existing calendar, and keep track of it all so you can adjust later.</p><p>An agent can take that same request and do something different.</p><p>It might:</p><ul><li><p>Check your calendar for available dates before suggesting anything</p></li><li><p>Search for flights and filter by your preferred departure times</p></li><li><p>Cross-reference hotel locations against the addresses you need to visit</p></li><li><p>Build a day-by-day itinerary that accounts for travel time between meetings</p></li><li><p>Save the whole plan somewhere you can find it and update it later</p></li><li><p>Flag the gaps &#8212; &#8220;I found flights and hotels, but you haven&#8217;t told me whether you need a visa&#8221;</p></li><li><p>Filter results by your stored preferences &#8212; early-morning flights, boutique hotels</p></li><li><p>Use your past travel patterns to anticipate the kind of trip that fits your style</p></li></ul><p>The agent doesn&#8217;t just <em>tell</em> you about the city. It assembles a usable, integrated plan. It uses tools to search, compare, read your calendar, write the plan, and flag what is missing. It loops through those actions until the trip is actually planned or until it hits something it cannot resolve without your input.</p><p>That is the difference between an answer and an outcome.</p><div><hr></div><h2><strong>The Key Transition</strong></h2><p>The shift to understanding agents is not about capabilities. It is about the move from isolated exchanges to sustained work.</p><p>A chatbot gives you an answer. An agent helps you reach an outcome. One is a single exchange; the other is a process. One is clever; the other is useful in a different way &#8212; not smarter, but more continuous.</p><p>The loop is what makes that continuity possible. Observe, think, act, check what happened, adjust, and continue until the work is done.</p><p>Once you see that pattern, you start to notice it everywhere. A junior colleague troubleshooting a problem is running a loop: try something, see if it worked, try something else. A project manager steering a complex task is running a loop: check the status, identify what needs attention, act, and review.<br>The same pattern appears everywhere in life. A cook adjusts a recipe by tasting as they go. A teacher tries an explanation, sees whether the student understood, and tries a different approach if they didn&#8217;t.</p><blockquote><p><em>Stephen:</em> So, tell me if I got this right: The agent loop is mimicking how we, humans, work.</p><p>We understand the problem, get the relevant context, perform an action, look at the result of our action and then decide whether that solves our problem. If it doesn&#8217;t, we explore why, come up with a new plan, implement the new actions, and repeat the process.</p><p>It feels like the agent is going through the same process.</p></blockquote><p>That is exactly right. The agent loop isn&#8217;t some exotic new form of intelligence. It&#8217;s a pattern humans use all day every day, made explicit and embedded in a system that can act. The insight isn&#8217;t that the AI has become more intelligent. It&#8217;s that the AI has gained the ability to persist, to use tools, and to continue &#8212; the same things that turn a one-off answer into real, completed work.</p><p>That is why this moment in AI feels different from previous ones. It is not that models suddenly became smarter. It is that they gained the ability to take action in a loop, over time, toward a goal.</p><div><hr></div><h2><strong>What This Series Will Do</strong></h2><p>This series is for people like me (Stephen, not Priya!), who already understand how LLMs work, who have used chatbots like ChatGPT or Claude, and who are now hearing about &#8220;agents&#8221; and wondering what that actually means. I felt I was lagging in the AI world so I started this learning process to make sure I&#8217;m not left behind!</p><p>We will move beyond the half-done feeling and into the architecture of agentic systems. We will look at what agents actually are, how they are structured, what tools and skills give them their power, how multiple agents can coordinate, and how to think about trust, evaluation, and oversight.</p><p>We will also look at the platforms and frameworks that exist today &#8212; what they offer, how they differ, and what tradeoffs you are choosing when you pick one. This is not a manual for any one platform. It is a guide to understanding the category itself, so you can make good choices about whether, where, and how to use agentic AI in your own work.</p><p>The field moves fast. Some tools that looked promising six months ago may be superseded by the time you read this. That is fine. The principles matter more than the products. If you understand the loop, the anatomy, and the tradeoffs, you can look at whatever the current landscape happens to be and know what you are seeing.</p><div><hr></div><p><em>Here&#8217;s the draft Table of Contents of this series in <strong>Agents Unpacked</strong>. This is likely to change as Priya and I progress through this project</em>:</p><ul><li><p><a href="https://www.thepythoncodingstack.com/p/stephens-preface-to-agents-unpacked-ai-agents">Stephen&#8217;s Preface to </a><em><a href="https://www.thepythoncodingstack.com/p/stephens-preface-to-agents-unpacked-ai-agents">Agents Unpacked</a></em></p></li><li><p>Part I &#8212; The Mental Shift</p><ul><li><p>Chapter 1 &#8212; From Answer to Outcome <em>(this post)</em></p></li><li><p>Chapter 2 &#8212; Anatomy of an Agent</p></li><li><p>Chapter 3 &#8212; Skills, Tools, and the Action Loop</p></li></ul></li><li><p>Part II &#8212; Agents in Practice</p><ul><li><p>Chapter 4 &#8212; Why One Agent Is Often Not Enough</p></li><li><p>Chapter 5 &#8212; Where Agents Are Actually Useful</p></li><li><p>Chapter 6 &#8212; Delegation Design</p></li></ul></li><li><p>Part III &#8212; Building and Trusting Agentic Work</p><ul><li><p>Chapter 7 &#8212; Designing Your First Agentic Workflow</p></li><li><p>Chapter 8 &#8212; When Things Go Wrong: Evaluation, Guardrails, and Trust</p></li><li><p>Chapter 9 &#8212; What to Build Next<em><br></em></p></li></ul></li></ul><div><hr></div><p><em>&lt;&lt; Previous Post: <a href="https://www.thepythoncodingstack.com/p/stephens-preface-to-agents-unpacked-ai-agents">Stephen&#8217;s Preface to Agents Unpacked</a></em></p><p><em>&gt;&gt; Next Post: <a href="https://www.thepythoncodingstack.com/p/2-anatomy-of-an-agent">2. Anatomy of an Agent</a></em></p><p><em><a href="https://www.thepythoncodingstack.com/p/table-of-contents-agents-unpacked">Table of Contents</a></em></p><div><hr></div><p><em><a href="https://stephengruppetta.com?utm_source=the-python-coding-stack">stephengruppetta.com</a></em></p>]]></content:encoded></item><item><title><![CDATA[Table of Contents • Agents Unpacked]]></title><description><![CDATA[Here&#8217;s the planned Table of Contents.]]></description><link>https://www.thepythoncodingstack.com/p/table-of-contents-agents-unpacked</link><guid isPermaLink="false">https://www.thepythoncodingstack.com/p/table-of-contents-agents-unpacked</guid><dc:creator><![CDATA[Stephen Gruppetta]]></dc:creator><pubDate>Sun, 24 May 2026 18:19:57 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/9e8d0940-bfb7-447b-9cee-358f7712a48d_600x600.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Here&#8217;s the planned Table of Contents. This is likely to change as Priya and I work on this:</p><ul><li><p><a href="https://www.thepythoncodingstack.com/p/stephens-preface-to-agents-unpacked-ai-agents">Stephen&#8217;s Preface to </a><em><a href="https://www.thepythoncodingstack.com/p/stephens-preface-to-agents-unpacked-ai-agents">Agents Unpacked</a></em></p></li><li><p>Part I &#8212; The Mental Shift</p><ul><li><p><a href="https://www.thepythoncodingstack.com/p/understanding-ai-agents-from-answer-to-outcome">Chapter 1 &#8212; From Answer to Outcome</a></p></li><li><p><a href="https://www.thepythoncodingstack.com/p/2-anatomy-of-an-agent">Chapter 2 &#8212; Anatomy of an Agent</a></p></li><li><p>Chapter 3 &#8212; Skills, Tools, and the Action Loop</p></li></ul></li><li><p>Part II &#8212; Agents in Practice</p><ul><li><p>Chapter 4 &#8212; Why One Agent Is Often Not Enough</p></li><li><p>Chapter 5 &#8212; Where Agents Are Actually Useful</p></li><li><p>Chapter 6 &#8212; Delegation Design</p></li></ul></li><li><p>Part III &#8212; Building and Trusting Agentic Work</p><ul><li><p>Chapter 7 &#8212; Designing Your First Agentic Workflow</p></li><li><p>Chapter 8 &#8212; When Things Go Wrong: Evaluation, Guardrails, and Trust</p></li><li><p>Chapter 9 &#8212; What to Build Next</p><p></p></li></ul></li></ul>]]></content:encoded></item><item><title><![CDATA[Stephen's Preface to Agents Unpacked]]></title><description><![CDATA[Why I Built an Agent to Teach Me About Agents, Using My Own Teaching Style]]></description><link>https://www.thepythoncodingstack.com/p/stephens-preface-to-agents-unpacked-ai-agents</link><guid isPermaLink="false">https://www.thepythoncodingstack.com/p/stephens-preface-to-agents-unpacked-ai-agents</guid><dc:creator><![CDATA[Stephen Gruppetta]]></dc:creator><pubDate>Sun, 24 May 2026 18:15:54 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/c257129b-5ce6-4b01-ba63-dba047146b03_600x600.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Like many, I started using chatbots when GPT whatever-version-it-was came out and took the world by storm. It was really not very good at the time (compared to today&#8217;s top-end chatbots), but it was clearly the start of something.</p><p>But things moved quickly, and I couldn&#8217;t quite catch up. I was busy with, you know, actual work, family, and life.</p><p>Then I started hearing lots of new terms, lots of new acronyms. I didn&#8217;t know what they were. I still don&#8217;t know what most of them are.</p><p>Then it was all about agents. I remember clearly thinking to myself: &#8220;Is this really any different from the ChatGPT-type chatbots?&#8221;</p><p>And here&#8217;s where this new series comes in. I decided to dive into agents and created a few. One of them is a learning tutor agent that I personalised to suit me.</p><p>I gave the agent all my tutorials and books. I gave the agent all the articles I wrote about my views on learning and technical writing.</p><p>I asked the agent to figure out from all this how I like to learn, how I like to communicate. I teach the way I like to learn, so it&#8217;s fine to put my teaching style in the mix. Then, I had a good long chat with my learning tutor agent to make sure we&#8217;re on the same page.</p><p>I gave a name to my agent (I named all my agents!) My personalised tutor is Priya.</p><p>This series is the joint effort between Priya and me to help me understand agents. What are they? How do they work?</p><p>Yes, it&#8217;s AI-generated content. But...</p><ol><li><p>It&#8217;s generated by an AI that&#8217;s extremely well-versed in my style of learning and communication.</p></li><li><p>I had an active role in steering and editing the content. Here&#8217;s how...</p></li></ol><p>What you&#8217;ll read in the following articles was created using the following process:</p><ol><li><p>Priya researched the topic following my brief and created a course outline.</p></li><li><p>She drafted the first chapter.</p></li><li><p>I read through the file, leaving comments and questions along the way, directly within the text.</p><ol><li><p>I marked some comments as <em>private</em>.</p></li><li><p>I marked some comments as <em>public</em>.</p></li></ol></li><li><p>Priya revised the chapter by incorporating my comments and questions.</p><ol><li><p>She deleted the private comments from the text after making changes to address my comments.</p></li><li><p>She kept my public comments and questions in the text, clearly marked as &#8220;Stephen&#8217;s questions&#8221;, and she answered them directly in the text.</p></li></ol></li><li><p>I reviewed the chapter again and left more comments, and Priya revised the chapter again. We iterated through this until I was happy with the final text. And I was happy with the final text when I felt I understood everything in it and all my questions had been answered.</p></li><li><p>Priya then moves on to draft the second chapter, and the whole process starts again.</p></li></ol><p>I will post these chapters as they emerge from this process. This is how I&#8217;m learning this topic. Hopefully, they may help some other people, too.</p><p>Here&#8217;s the planned <strong>table of contents</strong> for this <em>Agents Unpacked</em> series. But note, this may change!</p><ul><li><p>Stephen&#8217;s Preface to Agents Unpacked <em>(this post)</em></p></li><li><p>Part I &#8212; The Mental Shift</p><ul><li><p><a href="https://www.thepythoncodingstack.com/p/understanding-ai-agents-from-answer-to-outcome">Chapter 1 &#8212; From Answer to Outcome</a></p></li><li><p><a href="https://www.thepythoncodingstack.com/p/2-anatomy-of-an-agent">Chapter 2 &#8212; Anatomy of an Agent</a></p></li><li><p>Chapter 3 &#8212; Skills, Tools, and the Action Loop</p></li></ul></li><li><p>Part II &#8212; Agents in Practice</p><ul><li><p>Chapter 4 &#8212; Why One Agent Is Often Not Enough</p></li><li><p>Chapter 5 &#8212; Where Agents Are Actually Useful</p></li><li><p>Chapter 6 &#8212; Delegation Design</p></li></ul></li><li><p>Part III &#8212; Building and Trusting Agentic Work</p><ul><li><p>Chapter 7 &#8212; Designing Your First Agentic Workflow</p></li><li><p>Chapter 8 &#8212; When Things Go Wrong: Evaluation, Guardrails, and Trust</p></li><li><p>Chapter 9 &#8212; What to Build Next</p></li></ul></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thepythoncodingstack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thepythoncodingstack.com/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item></channel></rss>