Free sample lesson ยท Fullstack AI Engineering for Web Developers
AI Landscape
What actually separates AI, machine learning, LLMs, and agents?
Lesson 1 of the Wondering course Fullstack AI Engineering for Web Developers
Are a chatbot and an agent the same?
Imagine you are a web developer adding three features to a support app.
Tag tickets as urgent. Answer customer questions in a chat widget. Automatically issue refunds by calling your billing API.

Notice how different the three jobs are: one labels, one talks, one takes action in billing.
Marketing tends to call all three of these "AI." So you might reach for the same tool every time.
Picking one tool for everything means overspending on some features and overbuilding others.
So here is the real question: are LLMs and agents just different names for the same thing?
Are these just buzzwords for ChatGPT?
Many newcomers treat AI, machine learning, LLM, and agent as interchangeable words for "ChatGPT-like stuff."
That belief makes sense. Marketing uses the terms loosely, and most demos you see show a chatbot.
But look at the refund feature. A chatbot only replies with text, while a refund means checking an order and calling your billing API.
- Common belief
- Better model
These terms are nested layers, each one sitting inside the one before it.
So where does the broadest layer end and learning from data begin?
Machine learning swaps rules for examples
AI is the broad goal: systems doing tasks that need human intelligence, like understanding language or making decisions.
Machine learning (ML) is AI where you do not hand-write rules. A model learns patterns from labeled examples, and training adjusts its internal parameters.
Suppose you have 10,000 past tickets labeled urgent or not. A small ML classifier learns from those labels, so tagging is cheap and needs no LLM.
- AI: The broad goal of human-like tasks.
- Machine learning: Learns patterns from labeled examples.
- Neural networks: Layers of weighted connections.
- Deep learning: Neural networks with many layers.
Urgent tagging lives in the ML layer.
ML models built from layers of weighted connections are neural networks. Many layers means deep learning.
What happens when deep learning meets huge amounts of text?
An LLM predicts text, nothing more
A large language model (LLM) is a deep neural network, usually a transformer, trained on huge text datasets to predict the next token.
At massive scale, that one skill lets it write, summarize, answer questions, and generate code from a prompt.
So the chat widget, which needs open-ended language, calls an LLM.
- Can do
- Write and summarize
- Answer questions
- Generate code
- Cannot do alone
- Look up your database
- Take actions
Text in, text out.
But on its own, an LLM only takes text in and sends text out. It cannot look up your database or take actions.
So how does it answer questions about your own data?
RAG grounds answers in your data
Your chat widget will get questions about your own products and policies. A bare LLM never saw that private data.
Retrieval-augmented generation (RAG) fills that gap. Your code fetches relevant documents and adds them to the prompt.
- Question arrives: A customer asks about your products or policies.
- Fetch documents: Your code fetches the relevant documents.
- Add to prompt: Those documents are added to the prompt.
- LLM answers: The answer rests on your own data.
The LLM stays the same, but RAG hands it the right text, so answers rest on your own data.
Still, reading is not acting. What does the refund feature need?
An agent is an LLM in a loop
The refund feature has to decide, check an order, call refund(), and then confirm.
One text reply cannot do that. So you wrap the LLM in an agent loop with tool access.
The model decides a next step, calls a tool such as an API, search, or code execution, looks at the result, and keeps going until the task is done.
- Decide next step: The LLM picks what to do, like checking the order.
- Call a tool: An API, search, or code execution, such as refund().
- Look at result: The output feeds the next decision until the task is done.
An agent is still an LLM. The loop and the tools are what let it act.
So with every layer named, how do you choose?
Pick the smallest layer that works
Back to the support app. LLMs and agents are not different names for one thing.
Each term sits inside the one before it: an agent is an LLM running in a loop with tools, and an LLM is one kind of ML model.
So ask which layer a feature needs. A narrow prediction with labeled data needs a small ML model. Open-ended language needs an LLM.
Answers from private data need RAG. Multi-step actions need an agent.
- New feature
- Narrow labeled prediction?
- Small ML model: Like urgent tagging.
- Multi-step actions?
- Agent: Like auto-refunds.
- Private data answers?
- RAG
- LLM: Open-ended language.
Three features, three layers, no overbuilding.
Check yourself
A teammate says, "LLMs and agents are just two names for the same chatbot thing." In fact, an agent is _____
- an LLM running in a loop that calls tools and acts on the results
- another marketing name for an LLM that chats with users
Answer: an LLM running in a loop that calls tools and acts on the results
An agent wraps an LLM in a loop: the model picks a next step, calls a tool such as an API, looks at the result, and keeps going until the task is done. An LLM on its own only takes text in and sends text out, so the two are not the same thing.
Which statement correctly describes how machine learning (ML) and large language models (LLMs) relate?
- Every LLM is an ML model, but not every ML model is an LLM
- Every ML model is an LLM, but not every LLM is an ML model
- LLMs and ML are separate, competing technologies
- LLMs follow hand-written rules, while ML models learn from data
Answer: Every LLM is an ML model, but not every ML model is an LLM
The terms are nested. An LLM is one kind of ML model, trained on huge amounts of text. Many other ML models, like a small ticket classifier, are not LLMs. ML and LLMs are layers of one family, not rival technologies.
You run a website with a contact form. You have 5,000 old messages already labeled "spam" or "not spam." You want to flag new spam cheaply. Which layer of AI fits best?
- A small ML classifier trained on the labeled messages
- An LLM that writes a reply about each message
- An agent that calls tools in a loop for each message
- RAG that adds company documents to each prompt
Answer: A small ML classifier trained on the labeled messages
This is a narrow prediction task with labeled data, so a small ML model can learn from the labels. It needs no open-ended language (LLM), no private documents (RAG), and no multi-step actions (agent). Picking those would be overbuilding.
Keep going
This is lesson 1 of 22 in Fullstack AI Engineering for Web Developers. Next up:
- Python Essentials
- LLM APIs
- Prompt Design
- Structured Output
- Streaming UIs
Wondering turns any topic into short lessons you can read, watch, or listen to, with practice questions and an AI tutor.