Intermediate 25 min

Concept: What Is an AI Agent? (Without Jargon)

The Simple Definition

An AI agent is a loop. Here’s what happens:

  1. The model reads the user message
  2. It decides what to do (maybe call a tool)
  3. If it calls a tool, the tool runs and returns a result
  4. The model sees the result and responds
  5. If needed, it loops back to step 2

That’s it. No complex theory, just a loop that can call tools.

Plain Chat vs. Agent

Plain Chat:

  • Input → Response
  • One turn, done
  • No actions, just text

Agent:

  • Input → Think → Call Tool → See Result → Respond (maybe loop)
  • Multiple turns possible
  • Can take actions, remember state

The Agent Loop

Here’s a visual of how the loop works. Watch how data flows through the system:


Interactive Diagram

This interactive diagram requires JavaScript to be enabled.

Diagram

Steps:

  1. User sends a message: "Add a task to buy groceries"
  2. LLM processes the message and decides what action to take
  3. LLM decides to call the addTodo tool
  4. Tool executes and returns the result (new todo created)
  5. Result is stored in memory for future reference
  6. LLM generates a response using the tool result and memory

Here’s an animated flow showing the same process:


Process Call Tool Execute Return Respond User Message LLM Decides Tool Call Tool Result LLM Response

Concept Check

Before we move on, let’s make sure you understand the basics:



Good! You understand the basics. Now let’s set up the project.