Back to course

Agent Concepts

Why AI Agents

See why passive LLMs hit a wall — and how tools turn a completion into something that can act on a goal.

Why AI Agents#

Learning objectives

  • 1Clone the course repo and complete the one-time local setup.
  • 2Explain the difference between a passive LLM and an active agent.
  • 3Describe why tool use changes what an LLM can accomplish.

Course materials and setup#

All labs use the same repo and environment. Set this up once before the Build with smolagents module.

You need:

  • Python 3.10+
  • uv — Python package manager used in every lab
  • Hugging Face account and API token (HF_TOKEN in .env)
  • Later lessons: OpenAI API key (multi-agent), Docker or LangFuse Cloud (monitoring), MCP Foundations recommended before the MCP lesson
bash
git clone https://github.com/XamHans/smolagents-course && cd smolagents-course
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv && source .venv/bin/activate && uv sync
cp .env.example .env   # HF_TOKEN from huggingface.co/settings/tokens

Prepare your lab environment

Repo cloned, uv env active, HF_TOKEN in .env.

  1. Clone the repo and run the setup block above.
  2. Skim the PDF slides for the LLM-to-agent overview — it matches this lesson.
  3. Confirm `uv run first-agent.py` works after lesson 6 (or try now if you are eager).

This lesson is theory. The next two lessons nail down the agent definition and the workflow spectrum. Hands-on smolagents starts in module 2.

LLMs are powerful but passive#

A large language model takes text in (the prompt) and text out (the completion). It learned patterns from training data; it does not live in your environment.

Ask Claude to analyze a GitHub repo without pasting anything in, and you get a polite refusal: it can comment on a README you copy, but it cannot fetch the repository itself. You do the legwork; the model gives instructions you execute manually.

That is the default LLM shape: passive. Useful for drafting and reasoning on what you already gave it — limited for tasks that need fresh data or multiple steps in the real world.

Tools turn an LLM into an agent#

ChatGPT and Claude now ship capabilities that change the picture: web search, PDF analysis, code execution. Ask ChatGPT to analyze the same GitHub repo and it searches the web, pulls context, and returns an answer — because it can act on your goal, not just comment on static input.

That shift — from passive completion to active interaction — is the bridge from LLM to agent.

An AI agent is an LLM plus the ability to interact with its environment: call tools, run code, read results, reason about what to do next, repeat until the goal is met or a limit is hit.

That loop — plan, act, observe — is what separates a chatbot reply from something that can pursue a goal on its own.

When to build an agent

Use when
The task needs multiple steps, external data, or code execution you cannot fit in one prompt.
Avoid when
A single well-crafted prompt with retrieved context is enough.
Why is 'just use GPT' not enough for market research?

Answer: The model needs fresh data and iterative steps — search, read, analyze — not one static answer.

Key takeaways

  • Takeaway 1: LLMs alone are passive; agents add tools, actions, and a loop.
  • Takeaway 2: Tool use is what lets a model act on the world instead of only commenting on what you paste in.
  • Takeaway 3: Repo, slides, and setup live here — reuse them for every lab in module 2.

Research links

Question 1 of 10%
What distinguishes an AI agent from a single chat completion?