Exova Academy

Module 1 — AI Agent Fundamentals · 35 min

What an AI agent is (and when not to build one)

A product team decides to "add an AI agent" to its customer support. Three months later, the prototype is impressive in demos but costs $0.40 per conversation, sometimes misses the point, and created 200 duplicate tickets one Friday night. The problem wasn't the model: it was the initial decision. Nobody had defined what an agent is, what it adds compared to a simple chain of calls, or what justifies its cost. This lesson gives you an operational definition, a decision grid, and the framing of the project you'll build throughout the course.

Chatbot, workflow, or agent: an operational definition

Today the word "agent" is used for almost anything involving an LLM. To design one, you need a definition that translates into code. The deciding criterion is simple: who decides the next step?

System type Who decides what happens next? Number of LLM calls Example
Single call Nobody: one input, one output 1 Summarize a ticket
Chatbot The user, message after message 1 per message FAQ assistant without tools
LLM workflow The code, along a path written in advance Fixed (2 to 10) Classify an email, then extract the fields, then write a draft
Agent The model, based on what it observes Variable, not known in advance Search the docs, run another search, decide whether to create a ticket or escalate

An agent is therefore a program in which a language model chooses the actions to take, observes their results, and repeats until it reaches the goal or a stopping condition. The code surrounding the model, called the harness, provides the tools, executes the actions, enforces the rules, and decides what is allowed.

This distinction has a practical consequence: in a workflow, you can test every branch. In an agent, the possible paths are combinatorial. You trade predictability for flexibility, and that trade has to be justified.

%% titre: Who decides the next step?
%% narration: This diagram shows that the type of system comes down to a single question: who chooses what happens next. Nobody for a single call, the user for a chatbot, the code for a workflow, and the model itself for an agent.
flowchart TD
  Q{"Who decides the next step?"}
  Q -- "nobody" --> A["Single call"]
  Q -- "the user" --> B["Chatbot"]
  Q -- "the code" --> C["LLM workflow"]
  Q -- "the model" --> D["Agent"]
Who decides the next step?

The agentic loop

Whatever the framework, every agent relies on the same loop:

  1. Context: the model receives the system instructions, the history, and the list of tools.
  2. Decision: it responds either with a final text or with one or more tool call requests.
  3. Action: your code executes the tool (SQL query, API call, document search).
  4. Observation: the result is sent back to the model as a message.
  5. Repeat until the model responds without requesting a tool, or a limit is reached.
user ──► [LLM] ──► tool_use ──► [harness: executes] ──► tool_result ──┐
           ▲                                                          │
           └──────────────────────────────────────────────────────────┘
   stop: stop_reason = "end_turn", step limit, budget, or error

The point never to forget: the model does nothing by itself. It emits a structured request ("call create_ticket with these parameters"). Your code executes it or refuses it. Security, permissions, logging, and human approval all happen at that point. An agent is never more dangerous than the tools you give it.

%% titre: The agentic loop in five steps
%% narration: This diagram shows the loop: the model receives the context and decides, the harness executes the requested tool, then the result comes back to the model as an observation. The loop stops on a final answer or on a limit.
flowchart LR
  A["Context: system, history, tools"] --> B{"LLM decision"}
  B -- "tool_use" --> C["Action: the harness executes"]
  C --> D["Observation: tool_result"]
  D --> B
  B -- "end_turn" --> E["Final answer"]
  B -- "limit or error" --> F["Stop: steps, budget"]
The agentic loop in five steps

The autonomy spectrum

Between the rigid workflow and the free agent, there are intermediate positions. Locating them keeps you from building too much autonomy at once.

Level Description Customer support example
0 Single call, no tools Rephrase an answer written by a human
1 Fixed workflow Classify the request → search the KB → draft
2 Router An LLM picks one branch out of 4 predefined workflows
3 Agent with read-only tools The agent searches freely but changes nothing
4 Agent with write tools and guardrails Creates tickets, escalates, with approval for sensitive actions
5 Long-running autonomous agent Works through a ticket queue all night without supervision

Most useful business products sit at levels 2 to 4. Level 5 exists, but it requires a maturity in evaluation and observability that few teams have at the start. In this course, you'll progress from level 3 to level 4, then see in module 5 when to combine a router and an agent.

When not to build an agent

An agent costs more (several calls per request, a history resent on every turn), responds more slowly, and behaves less predictably than a workflow. Before writing one, run the request through four criteria:

  1. Complexity: does the task involve several steps whose sequence depends on intermediate results? "Extract the invoice number from an email": no. "Figure out why a customer's invoice is wrong": yes.
  2. Value: does the gain justify a cost 5 to 20 times that of a single call? Automating 30% of tier-1 tickets for a 12-person team: yes. Generating a button label: no.
  3. Viability: can a current model succeed at the task with the available information? If a competent human can't solve it with the same tools and documents, the agent won't either.
  4. Cost of error: is an error detectable and fixable? Answering a question about PDF export: an error can be corrected. Refunding €4,000: no, you need a human.

If any of the four criteria comes back "no," stay at the lower level. A few common warning signs:

  • The process is already described in a step-by-step procedure. Code the procedure, and use the LLM only for the language steps (understanding, writing).
  • Latency must be under one second. A three-turn loop often exceeds five seconds.
  • The result must be identical on every run. An agent doesn't guarantee that.
  • Nobody can say what a good answer looks like. Without a success criterion, you can neither evaluate nor improve.

Rule of thumb: start with the simplest solution that works, measure it, then add autonomy only where it delivers a measured gain.

%% titre: The four criteria before building an agent
%% narration: This diagram shows the decision grid: complexity, value, viability, and cost of error. A single "no" is enough to stay at the lower level; an agent is justified only if all four answers are "yes."
flowchart TD
  A["Request to automate"] --> B{"Complexity: dependent steps?"}
  B -- "yes" --> C{"Value: gain justifies the cost?"}
  C -- "yes" --> D{"Viability: can a human do it?"}
  D -- "yes" --> E{"Error detectable and fixable?"}
  E -- "yes" --> G["Agent justified"]
  B -- "no" --> W["Stay at the lower level"]
  C -- "no" --> W
  D -- "no" --> W
  E -- "no" --> W
The four criteria before building an agent

The running project: Helia

Throughout the course, you'll build Helia, the customer support agent for FacturaPro, a fictional SaaS invoicing software used by 8,000 small and mid-sized businesses. Support receives about 1,500 requests a day: how-to questions (PDF export, VAT, payment reminders), bugs, payment issues, refund requests, or account deletion requests.

Helia must:

  • Answer questions using the knowledge base (about 300 articles), citing the article used.
  • Create structured tickets when a problem requires technical intervention.
  • Escalate to a human for sensitive requests (refund, dispute, account deletion, very unhappy customer) or when it isn't sure.
  • Remember customer context without blowing up the token budget.
  • Be evaluated, secured, and monitored like any production service.

And Helia must not: issue refunds, change a subscription, access another customer's data, or promise a timeline that no system guarantees. Writing down this negative scope from the start matters as much as the list of capabilities.

A target conversation:

Customer: My March invoice shows VAT twice, I want a refund.
Helia   : [search_kb("VAT doubled March invoice")]  → KB-114 found
          [get_customer("cus_8812")]                → Pro plan, 2 open tickets
          Refund = sensitive action → escalate
          [escalate_to_human(reason="refund_request", priority="high")]
Helia   : This is a known issue, fixed since April 4 [KB-114].
          An agent will handle your refund request today.

For the code, you'll use the Anthropic SDK in Python (occasionally TypeScript) with three models: claude-haiku-4-5 (fast and inexpensive), claude-sonnet-5 (versatile), and claude-opus-5-5 (deepest reasoning). The next lesson explains how to choose between them.

Hands-on practice

You are a consultant for FacturaPro. Four automation requests come in. For each one, apply the four criteria (complexity, value, viability, cost of error), place the solution on the autonomy spectrum (level 0 to 5), and justify it in three lines max.

  1. Automatically translate knowledge base articles into English each time one is published.
  2. Answer customer questions about using the software (export, VAT, reminders, invoice templates).
  3. Detect cancellation requests in incoming emails and forward them to the sales team.
  4. Automatically refund customers affected by the March VAT bug.

Deliverable: a four-row table (request, verdict on the 4 criteria, chosen level, justification).

Show solution
Request Criteria Level Justification
1. Translating articles Low complexity (one step), real value, viable, fixable error 0 (single call) One input, one output. A script triggered by the CMS calls the model and saves the translation, with human review before publication.
2. How-to questions Variable complexity (one or more searches), high value (volume), viable, fixable error 3 then 4 The number of searches depends on the question: this is the textbook use case for an agent. Start read-only (level 3), then add ticket creation and escalation (level 4). That's Helia.
3. Detecting cancellations Low complexity (classification), medium value, viable, moderate error 1 (workflow) Classify then route is a fixed path. A classification call with structured output, followed by a code rule, is enough. An agent would only add cost.
4. Automatic refunds Low complexity, real value, but high cost of error (money, irreversible) No LLM for the action The list of affected customers is computed by an SQL query on March invoices. The refund is a deterministic accounting operation, approved by a human. At most, the LLM can draft the apology email.

Points to check in your answer:

  • You didn't propose an agent for requests 1 and 3: their path is known in advance.
  • For request 4, you recognized that the problem isn't a language problem. The classic mistake is wanting an agent "that handles refunds."
  • For request 2, you planned a gradual increase in autonomy rather than a write-enabled agent on day one.

Key takeaways

  • An agent is defined by one criterion: the model chooses the next step based on what it observes.
  • The model only requests actions; the harness executes them, and that is where security and control happen.
  • Before building an agent, check complexity, value, viability, and cost of error. A single "no" is enough to stick with a workflow.
  • Most useful products sit between the router and the write-enabled agent with guardrails.
  • Helia, FacturaPro's support agent, has a positive scope (answer, tickets, escalation) and an explicit negative scope (never refunds or cross-customer access).

Enjoyed this lesson?

Unlock all 40 lessons, the quizzes and the certificate.

Buy — $297