Skip to content
GenAI Learn/Safety, Model Choice & First Agents
Browsing as a guest. Sign in to save your progress and earn XP as you complete chapters.

What Is an Agent, Anyway?

5 min read

You'll learn to

  • -Define an agent as a model plus tools plus a loop, not a single call
  • -Trace a function-calling exchange: the model requests, your code executes, the result goes back
  • -See why a chatbot can claim to have done something it never did

A chatbot tells a user "I've scheduled that meeting with Sarah for next Tuesday at 2pm", and nothing happens. No calendar event exists anywhere. The model produced a plausible, confident sentence describing an action, because producing plausible text is what a language model does. It has no built-in way to reach outside itself and act on the world. An agent is the architecture that closes exactly that gap.

An Analogy: The Advisor and the Assistant With a Phone

An advisor who can only talk will tell you "I'll book that for you" and then do nothing, because they have no phone. An assistant with a phone and a calendar can actually pick up the phone, check, book, and report what happened. The model is the advisor. Tools are the phone and the calendar. The loop is the assistant checking after each call before deciding the next one.

The Minimal Definition: LLM + Tools + a Loop

Everything so far in this tier was a single request with a single response. An agent breaks that pattern in one specific way. Instead of only producing text, the model is given a set of tools it can choose to call, such as a calendar API, a search function or a database query. And instead of stopping after one response, the system runs a loop: it feeds a tool's result back to the model so it can decide the next step, repeating until the task is truly done.

Function Calling: How a Model Actually Invokes a Tool

The mechanism underneath is function calling. Alongside the prompt, you describe each available tool to the model as a schema: a name, a description of what it does, and the parameters it accepts. The model does not run anything itself. It can never reach outside its own context. When it decides a tool is needed, it outputs a structured request naming the function and the arguments. Your application code is what actually executes the call and returns the real result into the conversation.

A Fuller Trajectory: Two Tool Calls, Not One

Real tasks seldom resolve in one tool call. Scheduling that meeting properly means checking availability first and booking only if the check comes back clear: two full reason-act-observe cycles before the agent has enough grounded information to answer. The demo runs this. The "model" is a stand-in that only decides what to do next. The tools and the loop are real code.

Press Run: a text-only reply books nothing, the agent loop checks, then books

Now step through the same shape in the interactive trace below. Notice the pattern repeating: think about what is needed, act by calling a tool, observe the real result, then think again with that new information in hand.

Tracing an Agent's Reason-Act-Observe Loop

Two full tool-call cycles before the agent has enough grounded information to answer.

User

"Schedule a meeting with Sarah next Tuesday at 2pm."

step 0 / 7

This Is a Preview, Not the Full Picture

This is still, relatively speaking, the simplest kind of agent: a fixed, predictable sequence of two tool calls. The Agents and Tool Use tier ahead builds much further. It names and formalizes the ReAct pattern, which explicitly interleaves reasoning about what to do with acting. It covers agents that plan and decompose multi-step tasks, agents that keep memory across a long task, multiple agents collaborating, and the hardening work (error handling, evaluation, orchestration) that turns a working demo into something safe to run in production.

The mental model to leave with: a tool call is not the model "doing" something. It is the model asking your application to do something, and reporting back on the real result. Every layer of safety, validation and human oversight this course covers for agents sits at that boundary, between the model's request and your code actually executing it.

Interview Signal is part of Pro

See a real weak answer next to a real strong one for this exact topic.

Quiz is part of Pro

Test what you just read with a short quiz, and bank the XP.

Ready to Build This?

Build the Safety Net, Model Selector, and First Agent levels in the GenAI Lab: guardrails, model choice, and your very first agent.

Discussion0

Join the Discussion

Sign in to leave comments, reply to others, or like insights.

Sign In to ScaleDojo

No comments yet. Be the first to start the thread!