Module 0 · Format Example · scripted

Agent Loops

20 minoutcomes: agent-architectures

The loop is just a conversation talking to itself

An agent isn't a new kind of program — it's a conversation where the model's replies include actions, and the world replies back.

Everything the agent "knows" at any moment is what's in the conversation. There is no other memory. Watch the conversation grow:

system

You are a research assistant. You may call tools to act on the user's behalf. Use them when they help; report what you find.

user

Find me three recent papers on multi-agent task decomposition.

assistant

I'll search for recent work on this.

assistant
⟨tool_use⟩
search_papers(q="multi-agent task decomposition", since=2024)
user
⟨tool_result⟩
[
  { "title": "Hierarchical Delegation in Agent Teams", "authors": "Wang et al.", "year": 2025 },
  { "title": "Role-Conditioned Task Decomposition", "authors": "Chen & Ito", "year": 2025 },
  { "title": "Failure Recovery in Cooperative LLM Agents", "authors": "Okafor et al.", "year": 2024 }
]
NoteWatch what just happened: the tool result is now in the conversation. The agent didn't "learn" anything — its memory grew by one message.
NoteNotice the roles: the result travels back as a user-role message. Now flip to the Chat tab — the end user sees none of this. The "agent" is a story we tell about a message list.
Contextsystem promptuser goaltool schemas+ tool call+ tool result
assistant

Here are three: Wang 2025 on hierarchical delegation, Chen & Ito 2025 on role-conditioned decomposition, and Okafor 2024 on failure recovery in agent teams. Want me to pull the abstracts?

NoteThe reply is conditioned on everything above it — including the tool result. That conditioning is the whole mechanism. When we say an agent "decides," we mean the conversation shaped its next turn.

Why this framing matters

Every technique in this course — context engineering, memory systems, planning, multi-agent coordination — is a strategy for managing this conversation as it grows. If you can read a conversation, you can debug an agent.

pattern languageExercise · A pattern language for your domain

Before the midday session: think of one task in your research domain that an agent could do. What would the conversation look like? What tool would it need first?