Demo 11

Agents: How do large language models execute multi-step tasks?

Why is an agent a looped control system rather than a one-shot answer? This chapter places agents after LLMs and RAG, explaining how planning, tools, observation, and revision form multi-step task execution.

Teaching interaction

Agent Loop Walkthrough

Why is an agent a looped control system rather than a one-shot answer?

Normal success

The first tool call returns a usable result, so the agent moves from observation directly to the final answer.

1 / 4

Break down the task and make a plan

The agent first divides the user's goal into executable steps, deciding what to look up, what to calculate, and what to answer.

Learning goals
  • Understand how an agent moves between planning, tool calls, observations, and a final answer.
  • Observe why a tool failure must revise the plan and repeat both the tool call and result inspection.
  • Distinguish a one-shot LLM answer from an agent system with a closed loop of external actions.
Simplification note

This teaching demo does not call real tools or a large language model. Tool results and revision paths are scripted to explain the agent loop.

Observation guide

An agent enters an action loop instead of merely chatting better

The earlier problem was that an ordinary LLM often generated a one-shot answer without continuously observing external state. Agents address multi-step task control, but they do not inherently solve tool safety, goal drift, cost, or evaluation. Their follow-on influence includes tool use, workflow automation, multi-agent systems, and safety evaluation.

References

Concept Check

Test The Core Intuition With One Question

This check supports reflection and never blocks the next chapter. Records stay on this device.

What should a reliable agent loop do first after a tool call fails?