🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
HTML MASTER CLASS /// LEARN TAGS /// BUILD STRUCTURE /// SEMANTIC WEB /// HTML MASTER CLASS /// LEARN TAGS ///

Why a Chatbot Can't Actually Triage a Ticket

Watch a plain chat completion attempt a multi-step task and understand exactly why an agent needs a loop, not just a longer prompt.

Narrated Video Summary
data-composition-id="aiagentsmasterclass-module1_lesson1"1280×720 @ 30fps3 clips0:58 total

What You're Building

Over this masterclass you will build TriageAgent — a real, working autonomous support agent from scratch. It will reason in a loop, retrieve real chunked documentation, decide when a fine-tuned classifier beats a hand-written prompt, and end up deployed behind a real AWS Lambda handler. Not watched — built, piece by real piece.

# The Agent You'll Build

1. A real reasoning loop (not a single call)
2. Real memory and retrieval
3. A real fine-tuning decision and dataset
4. A real AWS Lambda deployment

An Agent Loops. A Chatbot Doesn't.

An agent wraps a model in a loop: think, take one real action, observe the real result, and decide the next step based on it — repeating until the task is actually done. Next lesson: building that loop's skeleton for real.

/* Next: The ReAct Loop */
0:00 / 0:58
Scene 1 / 3 — What You're Building
Total XP: 0|💻 aiagentsmasterclass XP: 0

Skill Matrix

UNLOCK NODES BY LEARNING NEW TAGS.

Agent vs Chatbot

Narrating a process vs. running one.

Quick Quiz //

Why can't a single chat completion actually perform a multi-step task with real conditional branching?


🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.

Every real agent project starts with the same realization: a single model response can describe a process, but it can't actually run one.

1A Chat Completion Is One Shot, a Task Is a Process

Asking a model to 'check the priority, decide on escalation, and tell me what you did' in one prompt only ever produces one block of text describing a plausible sequence — the model cannot pause mid-generation to actually run a priority check against real rules, look up an actual policy, or trigger a real escalation, then continue based on what it found. It can only narrate that a process happened.

2What 'Agent' Actually Adds on Top

An agent is the code wrapped around a model that turns narration into a real process: it calls the model, inspects the output for a real action to take, executes that action for real, feeds the real result back in, and repeats. The model still only ever produces text one call at a time — the loop around it is what makes the difference between describing a process and running one.

3Step-by-Step Breakdown

What You're Building. Over this masterclass you will build TriageAgent — a real, working autonomous support agent from scratch. It will reason in a loop, retrieve real chunked documentation, decide when a fine-tuned classifier beats a hand-written prompt, and end up deployed behind a real AWS Lambda handler. Not watched — built, piece by real piece.

Watch a Plain Chatbot Fail a Multi-Step Task. Ask a real model to triage a support ticket end to end: check its priority, decide if it needs escalation, and say what it did. A plain chat completion can only produce one block of text — watch it try to describe doing all three steps at once, with no way to actually check anything or take a real action in between.

What is structurally different between a plain chatbot response and what a task like this actually requires?

  • The task requires multiple real steps — check a rule, retrieve relevant policy, decide, act — each depending on the outcome of the last, while a single chat completion can only produce one block of text in one shot.
  • The model simply doesn't know enough vocabulary related to customer support.

An Agent Loops. A Chatbot Doesn't.. An agent wraps a model in a loop: think, take one real action, observe the real result, and decide the next step based on it — repeating until the task is actually done. Next lesson: building that loop's skeleton for real.

Level Up 🚀

Advanced cheat sheets, SEO tricks, and interview prep for this topic.

Browser Support

ChromeSupported

Fully supported.

FirefoxSupported

Fully supported.

SafariSupported

Fully supported.

EdgeSupported

Fully supported.

Accessibility (A11y)

1Surface Each Agent Step, Not Just the Final Answer

A UI showing an agent's work should render each real action it took (checked priority rule, retrieved policy X) rather than only the final message, so a screen-reader user gets the same sense of what actually happened as a sighted user watching it unfold.

<li>Checked priority rule -> high</li>

SEO Implications

  • 1

    Target 'AI agent vs chatbot' and 'build an autonomous agent from scratch' separately

    Developers evaluating whether they need an agent search for the conceptual distinction and the practical build guide as different questions.

Best Practices

Reach for an Agent Loop Only When the Task Genuinely Needs Sequential, Conditional Steps

A task answerable correctly in one completion doesn't need a loop — the added complexity, latency, and cost of an agent should be justified by a real multi-step, conditional task.

Frequent Bugs

THE BUG

Assuming a longer, more detailed prompt can substitute for an actual agent loop.

THE FIX

No amount of prompting gives a single completion the ability to check a real condition and branch on it mid-generation — that requires code around the model, not more instructions inside it.

Real-World Examples

Support Ticket Triage

A real support triage agent checks a ticket's real priority signals, retrieves the actual relevant policy document, and only then decides whether to escalate — each step depends on the real outcome of the one before it, which a single completion can't reproduce.

priority = check_priority(ticket)
if priority == "high": escalate(ticket)

Interview Prep

?Frequently Asked Questions

Pascual Vila

Pascual Vila

Frontend Instructor // Code Syllabus

Common Pitfalls & Errors

The Error //

Hardcoding sensitive credentials

// Wrong const API_KEY = 'sk-123456789'; // Correct const API_KEY = process.env.API_KEY;

The Solution //

Never hardcode API keys, passwords, or secrets in your source code. Use environment variables (.env files) to keep them secure and out of version control.

Lesson Glossary

[01]Agent

A system that wraps an LLM in a loop of reasoning, real action, and observation, repeating until a task is complete.

Code Preview
while not done: think(); act(); observe()

[02]Chat Completion

A single request/response call to an LLM that produces one block of text with no ability to pause and run real actions mid-generation.

Code Preview
response = call_model(messages)

Continue Learning