Free course · Lesson 2 of 5
The Parts of an Agent
In this lesson you will
- Name the components of an agent
- Trace the observe–think–act loop
Every agent has the same building blocks: a model that generates text, instructions that set its role and rules, tools it may ask the program to run, memory of the conversation (and sometimes of past sessions), and a loop that repeats observe, think and act until the task is done.
- The program runs the tools, not the model: the model only requests a tool, and the program checks the request first.
- Limits are essential: a maximum number of steps, a time limit and a cost budget stop runaway loops.
- Traces record every step, which is how you find out why an agent gave a wrong answer.
Question: "When are second-term fees due for the Python course?" Step 1 observe question received think need the fees document, not general knowledge act call search_documents("Python second term fees")Step 2 observe 2 passages returned: fees-2026 (sections 3 and 4) think section 3 gives the deadline act answer with citation fees-2026 s.3Done answer "Second-term fees are due by 14 March (source: fees-2026, section 3)." Limits: maximum 5 steps, 30 seconds, 4,000 tokens. This run used 2 steps.
Practice exercise
Using the worked example trace, label each step as observe, think or act, and say where you would put a step limit.
Key takeaways
- The program, not the model, runs the tools
- Every agent needs limits on steps, time and cost
Free self-study lesson — no certificate. For the full instructor-led program, see registration options.