Level 1.5 · Agents · Session 1 of 3
Meet the agent
What an agent is · the LLM engine · the agent loop — then build a working one.
Covers: Stations 1–3 · You'll need: the Session 1 Colab notebook + a free Gemini key
The shape of today
Learn the idea → build it
Three ideas, one build
- What is an agent? (talks vs acts)
- The engine underneath (a quick LLM recap)
- The agent loop — then you build a real one in Colab
1
Idea 1
Chatbot vs. agent
Concept · Two kinds of AI
Talks vs. acts
Just talksChatbot
One question in, one answer out. If unsure, it guesses.
Talks + actsAgent
Given a goal, it plans, uses tools, checks results, and loops until done.
🔑 The recipeAgent = LLM + tools + a loop. Brain, hands, and a cycle that keeps going.
Idea 2 · The engine
What it runs on: an LLM
- Reads text as tokens; the context window is how much it sees at once.
- Temperature tunes creativity — low = reliable (good for tool use).
- Open (run-your-own) vs closed (API) models — we'll use Gemini's free API.
RecapThis is Level 1 material — just enough to build agents. Deeper dive lives in Level 1 · Foundations.
Idea 3 · The loop
The agent loop
while not done:
# Perceive read the goal + any new info
# Reason decide the next step
# Act call a tool
# Observe read the result → repeat
🔑 RememberPerceive → Reason → Act → Observe → repeat. This loop (a.k.a. ReAct) is every agent.
⚡ Energizer · 10–12 min · on your feet
Agent or Not? — The Sorting Line
- Coach reads a task; students move to the AGENT or CHATBOT side.
- Defend it: does it need multiple steps + tools + looping, or one answer?
Printable card in Coach HQ → Session 1 energizer
▶
Build it
Make an agent in Colab
Build · the whole idea
A tool + a loop
for step in range(6):
resp = gemini(history, tools=[calculator, today])
if resp.wants_tool: # Reason → Act
out = run(resp.tool, resp.args)
history += observe(out) # Observe
else:
print(resp.text); break # goal reached
Goal in the notebook"What's today's date, and 1440 × 365?" — watch it call today and calculator instead of guessing.
Session 1 · Wrap
You built an agent 🎉
- Chatbot talks; an agent acts (LLM + tools + loop).
- You ran Perceive → Reason → Act → Observe in real code.
Next session → Powering the agent: more tools, sharper prompts, and memory.