Skip to content
ImagineWorld

The AI Agent

node_idnode-book_agentic-spec-driven-development_chapter-03-the-ai-agent
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num3
chapter_titleThe AI Agent
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

This chapter covers the AI agent — its components and how they interact. The agent is what makes “agentic AI” agentic. A chatbot answers one prompt with one reply. An agent turns one prompt into a multi-step task and completes it on its own.

When you talk to AI, you are not talking to one thing. You are talking to two.

The first is the local agent — a regular program running on your computer or, less often, on a remote server. It opens files, runs commands, displays the conversation, and sends and receives messages. It is fast, cheap, and not very smart on its own.

Claude Cowork is an agent. So are Claude Code, Cursor, GitHub Copilot, and ChatGPT in agent mode. These agents differ in interface, in the tools they offer, and in the kind of work they target, but the underlying architecture is the same. When this book says “agent,” it means software of that kind — whichever one you happen to use.

The second is the remote model — a large language model, or LLM, running on the vendor’s servers. The model is what does the reasoning. It has no memory between calls. It does not see your files. It does not know your preferences. It only knows what the agent puts in front of it on a single call.

The two halves work together. The agent runs on your computer; the model runs on the vendor’s server. The agent runs all the time. It calls the model only when there is reasoning to do. The agent costs almost nothing. The model is what you pay for.

The model on its own is not autonomous. Call it once and it returns text — a paragraph, a code block, a plan. That is all it can do. It cannot edit your file, run a command, search the web, or do anything else by itself. If that were the whole picture, you would have a chatbot.

What makes the system agentic is the agent’s loop, not anything special inside the model.

When you send a prompt, the agent does not just forward your text and pass the answer back. The agent assembles everything the model needs — the conversation so far, the list of tools the model can use, your prompt, and any files the agent always includes by design (like CLAUDE.md for Claude Code/Cowork). It packs all of this into a single payload and sends the payload to the model. The model reads the payload and sends a response back. This single round trip is called a turn. The agent reads the response and decides what to do next. If the model produced a final answer, the agent shows it to you, and the loop ends. If the model asked the agent to take an action — read another file, search the web, edit something — the agent performs the action locally, packs the result with everything else, and starts the next turn by calling the model again with the updated payload.

So one prompt does not mean one call to the model. One prompt becomes a chain: turn, local work, turn, local work, turn, until the model produces the final answer. You see only your question and that answer. Underneath, the agent and the model may have exchanged messages many times, with the agent doing real work between each round.

The book uses the word turn the way the agent industry uses it: one full trip to the model and back. A turn is not the same as “your turn to type” — the model and the agent take many turns between your messages. Some sources call the same thing a round trip or an API call.

Now the part that matters most for the rest of the book: every turn carries the whole conversation, not just your latest prompt.

Every turn ships the full payload: every prompt and response so far in the session; every file the agent has pulled into the conversation; every action it has taken, and every result that came back; any standing project materials the agent always includes. All of it.

All of this material taken together has a name: context. From here on, when the book says “context,” it means whatever the model is reading on the current turn — the conversation, the files, the results, the standing materials, the whole payload.

This is how the model stays in sync. The model has no memory of its own. The agent is the model’s memory, and it shares that memory by including the whole context in each payload. From the model’s point of view, the whole history arrives fresh on every turn.

Here is what one simple session (without tool calls) looks like in practice. Say you are naming a dog for a children’s story. The following shows how the conversation grows with each turn.

TurnConversation
1You: “I need a name for a golden retriever in a children’s book.”
Sent to LLM: all project rules “I need a name for a golden retriever in a children’s book.”
LLM: “How about Biscuit?”
2You: “Too common. Something more unusual.”
Sent to LLM: all project rules “I need a name for a golden retriever in a children’s book.” “How about Biscuit?” “Too common. Something more unusual.”
LLM: “How about Rumble?”
3You: “I like the direction. Give me one more option.”
Sent to LLM: all project rules “I need a name for a golden retriever in a children’s book.” “How about Biscuit?” “Too common. Something more unusual.” “How about Rumble?” “I like the direction. Give me one more option.”
LLM: “How about Bramble?”

By the third turn, the model receives the entire conversation from the beginning — your three prompts and both of AI’s earlier responses, plus the standing materials at the top — and reads it fresh, as if seeing it for the first time. The agent kept the history. The agent replayed it. The model just processed whatever landed in front of it.

The continuity you feel on screen is an illusion. The agent presents the exchange as one ongoing conversation; the model never feels that continuity. Each turn lands in front of a fresh reader who forgets everything once the turn ends.

There is no good human analogy here. You might compare the model to a person with amnesia, or someone who rereads their notes before every meeting. Both comparisons break down quickly. A person with amnesia still carries emotional traces, habits, and subconscious familiarity. A person rereading notes remembers some of the material and skims the rest. The model does neither. It has zero residual memory — not faded, not partial, none at all. Every turn, it reads the full conversation fresh, processes it, produces a response, and forgets. Nothing in human experience matches this. Understand the model on its own terms.

Several practical consequences follow. A long session costs more than a short one because there is more context to ship. A session that drifted off-topic carries that baggage forward — the agent does not edit the history. A fresh session is cheap. A stale session is expensive. Chapter 8 returns to these.

One variation is worth naming so you are not confused later. Some agents support sub-agents — separate sessions the main agent starts to handle a piece of work, then closes. Only the sub-agent’s summary comes back to the main session; the main session does not see the sub-agent’s full conversation. This is a way to handle expensive subtasks without dragging their full history into the main payload. The mechanics are agent-specific and deserve their own treatment, so the book does not lean on them. Know they exist.