Types of Agents — Goal-Based Agents — Beginner-Friendly Notes
1. What Changes vs Model-Based
Goal-based = model-based plus a goal to achieve. Instead of "if state is X do Y", it asks "which action gets me to my goal?"
State + Goal → Search/Plan → Action
Think: GPS — not "if at junction turn right" (reflex), but "find a path to the destination."
2. Inside the Agent
- State & model (as before) to know where you are.
- Goal description — what counts as success (e.g.,
all rooms clean,at destination,checkmate). - Search / planning (Module 2) — consider future actions:
if I do A then B then C → will I reach goal? - Choice: pick the sequence that reaches the goal.
3. Example — Vacuum with Goal "All Rooms Clean"
- State:
{A: Clean, B: Dirty, at: A} - Goal:
{A: Clean, B: Clean} - Plan:
MoveRight → Suck→ goal satisfied. - Reflex alone would need a rule for every combo; goal-based derives the action by reasoning.
4. Why Goals Are Powerful (and flexible)
- Different goals, same knowledge: same map can serve "go to hospital" and "go to airport" — just change goal.
- Look ahead: agent can handle sequential environments where actions have consequences (needs Module 2 search: BFS, DFS, A*).
5. Goal vs Reflex — Exam Contrast
| Reflex | Goal-Based |
|---|---|
if percept → action (no thinking ahead) |
if action sequence → goal ? (thinks ahead) |
| Fast, needs many rules | Slower, needs search, but general |
| Fails when plan of several steps needed | Succeeds by planning |
6. Still Missing (next topic)
Goals are binary (success/fail) — cannot prefer better vs good paths (shorter, cheaper, safer). That's utility-based.
7. One-Line Summary to Write in Exam
A goal-based agent tracks world state and uses search/planning to select the action sequence that achieves its explicit goal, enabling it to handle sequential, non-episodic tasks.
8. Quick Self-Check
- Why does GPS need to be goal-based, not reflex?
- What component from Module 2 does a goal-based agent rely on?