AI Primer

Agentic AI · Module 20

From language model to agent

An agent is an LLM wrapped in a loop that can use tools, maintain memory, plan, and execute multi-step work.

Tools

The agent can call code: search the web, run a SQL query, send an email, control a browser, edit files.

Memory

Short-term scratchpad for the current task; long-term store of prior decisions and learned patterns.

Planning

The agent decomposes a goal into steps, executes, observes the result, and revises the plan as needed.

Plan act observe review loop around a language model agent
Draft for editor review: an agent wraps a model in a repeatable work loop.

From model to agent loop demo

A local toy loop that logs the plan, act, observe, and review steps named in this module.

const steps = ['plan', 'act', 'observe', 'review'];
for (const step of steps) {
  console.log('agent loop:', step);
}
Run the demo to see sandboxed console output.

Agent loop check

0 of 1 questions completed locally.

1. Name one failure mode when an agent skips the observe or review step.

Answer feedback appears here.

Reader progress is stored locally in this browser.

Source slide 21