WEBVTT

00:00:00.000 --> 00:00:03.945
In previous lessons you saw
LLMs, RAG and tool calls.

00:00:03.985 --> 00:00:07.591
Now we connect all of that
into a loop that runs

00:00:07.631 --> 00:00:10.495
on its own until the goal is reached.

00:00:10.535 --> 00:00:15.088
That's an agent, and understanding
this loop is what separates

00:00:15.128 --> 00:00:19.410
people who build agents from people
who just use chatbots.

00:00:20.367 --> 00:00:24.927
There's huge confusion in the
market: calling anything an

00:00:24.967 --> 00:00:28.578
agent just because it uses a
language model.

00:00:28.618 --> 00:00:34.639
But a pure LLM takes a prompt and returns
text, no state, no action, no loop.

00:00:34.679 --> 00:00:38.655
An agent is different in
nature: the control flow

00:00:38.695 --> 00:00:42.087
lives inside the model, not in your code.

00:00:43.100 --> 00:00:45.634
Look at the difference in practice.

00:00:45.674 --> 00:00:49.779
In a fixed workflow, the code
decides the flow and the model

00:00:49.819 --> 00:00:53.546
just fills in gaps, useful and
predictable, but rigid.

00:00:53.586 --> 00:00:57.627
In an agent, the model gets the
goal and decides on its own

00:00:57.667 --> 00:01:01.269
which tools to use, in what
order, and when to stop.

00:01:01.309 --> 00:01:04.220
That autonomy is what changes everything.

00:01:05.233 --> 00:01:08.252
Every functional agent has four pieces.

00:01:08.292 --> 00:01:12.738
If one is missing, the system
degrades to something simpler.

00:01:12.778 --> 00:01:17.292
The model is the brain, it reasons
and decides the next step.

00:01:17.332 --> 00:01:21.982
Tools are the hands, without them the
model only produces text.

00:01:22.022 --> 00:01:25.040
Memory tracks what's already been done.

00:01:25.080 --> 00:01:28.575
And the planner, optional but
powerful, breaks

00:01:28.615 --> 00:01:31.633
big goals into sub-tasks before acting.

00:01:32.633 --> 00:01:37.499
The ReAct loop is the pattern
published in 2022 that combines

00:01:37.539 --> 00:01:42.185
reasoning and acting in an
interleaved cycle, and it's the

00:01:42.225 --> 00:01:46.432
most common way to implement
agents with LLMs today.

00:01:46.472 --> 00:01:50.312
Four phases repeat until the
goal is reached or

00:01:50.352 --> 00:01:53.754
the agent realizes it can't move forward.

00:01:54.767 --> 00:01:57.374
Each phase has a clear function.

00:01:57.414 --> 00:02:01.276
In perception, everything goes
into context: goal,

00:02:01.316 --> 00:02:04.899
history, previous results and
relevant memory.

00:02:04.939 --> 00:02:09.149
In reasoning, the model writes in
natural language what

00:02:09.189 --> 00:02:12.841
it will do and why, this
improves the decision.

00:02:12.881 --> 00:02:16.952
In action, it calls a tool with
the right parameters.

00:02:16.992 --> 00:02:21.132
In observation, it reads the
result and decides if the

00:02:21.172 --> 00:02:24.477
goal is met or if another cycle is needed.

00:02:25.467 --> 00:02:30.649
An important warning from someone who
designs agents in practice.

00:02:30.689 --> 00:02:36.385
Autonomy is the agent's superpower, but
also the source of its problems.

00:02:36.425 --> 00:02:42.048
Agents can loop, take unexpected paths or
use tools in the wrong order.

00:02:42.088 --> 00:02:46.167
Designing an agent means
thinking about guardrails

00:02:46.207 --> 00:02:49.477
from the start, not just functionality.

00:02:50.467 --> 00:02:55.553
Now you have the full anatomy: model,
tools, memory and planner,

00:02:55.593 --> 00:03:00.020
and you know how the ReAct loop
connects all of it in a

00:03:00.060 --> 00:03:04.487
cycle of perception, reasoning,
action and observation.

00:03:04.527 --> 00:03:09.687
In the next lesson we go deep into
memory: how to implement short

00:03:09.727 --> 00:03:14.447
and long-term so the agent actually
remembers what matters.
