Courses / Agentic AI from Scratch (Python)

Session 1 of 40

The journey: from one LLM call to an agent that acts

Notes

What Is an AI Agent, and How Does It Differ From a Chatbot? A Beginner’s Guide to Building One in Python

Agentic AI Foundations · Session 1 — The journey: from one LLM call to an agent that acts

Before you start: what do you need to learn how an AI agent works?

You can read this session with nothing installed. To do the two small tasks in the last part you need Python on your laptop, the course code folder for this session, and a model endpoint: a hosted provider, or a model server running on your own machine, that accepts the same request format as the openai Python package. A key from a provider such as Google Gemini will do; the README of the code folder says how to get one. You also give the script three settings: LLM_BASE_URL, LLM_API_KEY and LLM_MODEL, typed at the top of first_call.py or set in your terminal. Treat the key like a password, and do not share a script that holds it. The steps are in the README of the code folder. Keep paper or a notes app open: the Flashcards and the Model answer ask you to say and write things in your own words. You should be comfortable writing basic Python (variables, functions, lists, importing a library); you need no machine learning or maths.

Summary: what will you learn about LLMs, agents and the HelpDesk Copilot project?

This session is the map of the whole course. It introduces generative AI through one question an employee might ask, shows why a model alone invents answers it cannot know, and explains how an agent differs from a chatbot: a chatbot answers, an agent decides, uses tools and acts. It then introduces the project you build across the course, HelpDesk Copilot, an assistant for a fictional company’s employees that answers from policy documents and handles IT and HR tickets, with its three milestones and the tools used to build it. It ends with your first working code: set up Python, set three values, send a first message to a model from Python, and a look at what comes back and what to do when the run fails. Each later session adds one piece to what you start here.

Key concepts: LLM, hallucination, tool and agent defined in plain words

Term Definition
Generative AI Software that produces new text, images or code. In this course it means a large language model that writes text.
Large language model (LLM) A program trained on a very large amount of text. Given some text, it writes the text that most plausibly comes next, one small piece at a time.
Prompt The input you give a model: a question, instructions, and any text you want it to use.
Hallucination A reply that is fluent and confident but invented or wrong, such as a policy section that does not exist.
Tool An ordinary function an agent can call, for example one that looks up a ticket or creates one.
Chatbot A program that answers each message with text written by a model, with no way to look things up or change anything on its own.
Agent A program that uses a model to decide what to do next, calls tools, looks at what came back, and repeats until the job is done.
OpenAI-compatible endpoint A web address that accepts the same kind of request as OpenAI’s API, so the same Python code can reach different providers, or a model on your laptop, by changing the address, key and model name.
Setting (LLM_BASE_URL, LLM_API_KEY, LLM_MODEL) The three values the script needs: where to send requests, the key, and the model name. Type them at the top of the script, or set them in your terminal as environment variables; if a setting is in both places, the terminal wins.
Token A small piece of text, often part of a word. A model reads and writes in tokens, and a hosted provider charges per token.
API key A secret string that proves you may use a model endpoint. Treat it like a password and keep it out of project files.
Usage The part of a model’s reply that counts the tokens you sent, the tokens it wrote, and their total.
Milestone A checkpoint in the project where the Copilot can do a named new thing; the course has three, plus a final demo.

Explanations: how do an LLM, an agent and the course project fit together?

Where are we? The course in one picture

Think of this session as the plan of a house you are about to build: you walk through the finished rooms before you pick up a tool. Agentic AI Foundations has sessions grouped into modules. They build one thing, HelpDesk Copilot, an assistant for the employees of an invented company called Fernhill Systems. You write Python throughout and run the course code on your laptop; no cloud platform is needed for this session. The company, its policy files and its tickets are sample data supplied with the course.

Here is the idea in a picture, with no technical names yet:

 Employee ........ asks: "How many days can I carry over?"
     |
     v
 Company knowledge .... the right policy page is found
     |
     v
 Language model ....... writes the reply from that page
     |
     v
 Employee ........ reads the answer, with "Leave Policy 4.2" named

Ask, find the company’s own page, let the model write, show the source. By the end of the course you will have built an assistant that answers employees’ questions from the company’s policies with the source named, looks up and raises IT and HR tickets, and asks a person before it does anything risky.

What is generative AI and how does a large language model write a reply?

An employee types: “How many leave days can I carry over to next year?” A model answers at once: “Under Leave Policy 4.9 you can carry over twelve days, and carried days do not expire.” It names a section and a number, in a friendly voice. Nothing in it is checked. (This reply is illustrative, written for these notes. Fernhill’s real sample policy says something different.)

Here is what happened. Generative AI is software that produces new text, images or code. In this course it means a large language model (LLM): a program trained on a very large amount of text. It learned what usually follows what, and given your words it writes the text that most plausibly comes next, one small piece at a time.

Two ways to hold the idea:

  • Autocomplete on your phone, scaled up. Your phone suggests the next word from patterns in what you type. A model does the same with vastly more reading, so it can continue whole paragraphs.
  • A well-read colleague. They have read a library of public writing, so they can draft almost anything in a convincing voice. They have not read your company’s handbook.

What happens between the question and the answer is simple to describe, even if the inside is complicated. The question is cut into small pieces of text (called tokens, explained in the next section; a later session counts them). The model picks a likely next piece, adds it to the text so far, and picks again, repeating until the reply is complete.

 Your question (text)
        |
        v
 Cut into small pieces (called tokens)
        |
        v
 The model picks a likely next piece ----+
        |                                |
        v                                | repeat until
 Add it to the text so far  <------------+ the reply is done
        |
        v
 The reply (text)

What is a token in an LLM, and which other words will I hear?

Picture a sentence cut into small tiles, the way a word game gives you letter blocks. A short, common word may be a single tile; a long or rare word may take several. A model does not read your sentence as one block of text. It sees tiles. A second picture: a taxi meter. You do not pay for the trip as a whole, you pay for what the meter counted, and for a model the meter counts tiles.

Those tiles are called tokens: a small piece of text, often part of a word. Reference material on language models describes tokens as the smallest units a model works with, which can correspond to words, parts of words, characters or even bytes. A model reads your prompt in tokens and writes its reply in tokens, and a hosted provider may charge by the number of tokens: one provider’s pricing page lists most of its models per million tokens. A local model server runs on your own computer. The next session counts tokens in code and estimates what a call will cost before you send it.

Four more words come up throughout the session:

Word Plain meaning Everyday comparison
Prompt The text you send to a model: a question, instructions, and any text you want it to use The note you hand a colleague with the task on it
Model The trained program that turns your prompt into a reply The colleague who reads the note
API and endpoint The API is the set of requests a service accepts and the replies it sends; the endpoint is the web address your code sends them to The endpoint is the postal address; the API is the rule for how to write the letter
Key A secret string that proves you may use the endpoint A door pass: if someone copies it, they can walk in as you

Why does an LLM make things up? Three situations where a model alone falls short

A new colleague who has read many public books about workplaces speaks well about leave and laptops, but has not seen your handbook. A quiz guest who hates saying “pass” gives a fluent answer even when the honest answer is “I do not know”. The model learned from general text and writes what is likely, not what is checked. Researchers who studied this problem argue that language models make things up because training and evaluation procedures reward guessing over admitting uncertainty, much as an exam rewards a guess over a blank. A made-up but fluent reply is called a hallucination. A confident tone tells you nothing about whether a reply is true.

Three situations, failure first, then cause:

  1. An employee quotes “Leave Policy 4.9” from a chat, and HR says no such section exists. The model had no policy text, so it wrote what a policy would plausibly say.
  2. An employee asks “How many days do I have left?” and gets a confident number. The balance lives in an HR system the model cannot see, so the number was invented.
  3. An employee asks the assistant to raise a ticket for a broken laptop, it replies “Done, ticket created”, and no ticket exists. A model on its own writes text; creating a ticket needs a tool that does it.

Each gap has a fix, and each fix is a later session of this course.

How does an AI agent help with everyday jobs, without and with one?

Think of a good assistant who fetches the files, drafts the note and leaves the signing to you. In this section “agent” means a model that can look things up and act through tools; the next section defines it properly. Here are four everyday jobs, each shown the manual way and the agent way. The examples are illustrative, written for these notes.

Job Without an agent With an agent What stays with you
An employee asks a leave question Message the help desk and wait while a person searches the policy Ask in chat; the agent finds the policy section and answers with it named Exceptions, and any change to your record
An on-call engineer gets an alert at night Open dashboards, search logs, hunt for the runbook The agent reads the alert, pulls recent logs and the runbook, drafts a likely cause and a fix Judging the cause and approving any change
A finance person checks an expense claim Read each line, look up the rule, compare by hand The agent compares each line with the policy and flags the lines that do not fit The decision to pay, and exceptions
A developer joins a codebase Open files at random and ask around The agent searches the code and explains where things live Running the code to check the explanation

The on-call story, step by step. At night an alert fires. Without an agent, the engineer wakes up, opens dashboards, searches the logs, finds the runbook (the written steps for that kind of alert), guesses the cause and tries a fix. With an agent, the first part is done before the engineer is fully awake:

 Before
 Alert -> wake up -> open dashboards -> search logs
       -> find the runbook -> guess the cause -> try a fix

 With an agent
 Alert -> agent reads it, pulls recent logs and the runbook
       -> agent drafts the likely cause and a fix
       -> YOU review it and approve, change or reject
       -> agent runs the approved step and writes the notes

What moving that work to an agent removes is the waiting, the searching in several places and the retyping of notes. What it does not remove is judgement and approval: the engineer decides whether the drafted cause is right and whether a change goes ahead, because a change to a live system can do harm. No time saving is quoted here, because no figure is measured here; the point is the steps. People and agents work together: the agent does the hunt, and the person’s time goes to the decision.

What is an AI agent, and how is it different from a chatbot?

Picture the help desk. A chatbot is like a clerk who can talk but not act: you ask, they answer from memory and from whatever paper you slid across the counter, and they cannot open the HR system or file a form. An agent is the same clerk with a phone and a filing cabinet. It reads your request, decides what to do, looks things up or fills in a form, checks the result, and then tells you what happened.

Formally, an agent is a program that uses a language model to decide what to do next, calls tools (ordinary functions, such as a ticket lookup) to do it, looks at what came back, and repeats until the job is done. A second picture: a taxi driver with a map app chooses a turn, checks the screen, then chooses the next turn. In the Copilot, a question about ticket T-1042 makes the agent look the ticket up instead of guessing.

Aspect Chatbot Agent
Per question One reply written from the text it was given A decision, perhaps several tool calls, then a reply
Where facts come from The model’s memory and what you paste in Tools, such as the policy search or the ticket lookup
Can it change anything? No, it writes text Yes, through tools such as “create ticket”
When something is missing Tends to guess Can look it up, or say it cannot
HelpDesk Copilot The v0 terminal chatbot (a later session) The routed Copilot with tools (modules 5 to 7)

The agent works in a loop:

 Employee: "Raise a ticket for my broken laptop"
        |
        v
 +--> Decide: which tool, if any?
 |       |
 |       v
 |    Act: call the tool (create_ticket)
 |       |
 |       v
 |    Observe: "T-1058 created"
 |       |
 +-------+  enough to answer? if not, decide again
        |
        v
 Reply: "I raised ticket T-1058 for your laptop."

Decide, act, observe, repeat. Module 5 builds this loop. The Copilot starts as a chatbot in a later session and earns the word agent as tools are added.

What is the HelpDesk Copilot project and what will it do?

The brief. A project starts from a brief: what to build, for whom, and where to stop. The Copilot’s brief is short.

  • Who it is for: employees of Fernhill Systems who ask the help desk about leave, laptops, expenses and tickets.
  • What it answers from: sample policy files with numbered sections, such as Leave Policy 4.2, and sample IT and HR tickets, such as T-1042.
  • What it must do: answer from the policy with the section named; say “I don’t know” when the policy is silent; look up and raise tickets; ask a person before a risky action.
  • What it must not do: invent a policy, or act on a ticket without checking.
  • Where it runs: on your laptop, from the terminal first, then a chat page.

A sample conversation. This is the behaviour you are aiming at. It is illustrative, written for these notes; the company, policy numbers and tickets are invented.

Employee: How many leave days can I carry over?
Copilot:  Up to 5 unused days carry over and must be
          used by 31 March (Leave Policy 4.2).

Employee: What happened to my laptop ticket, T-1042?
Copilot:  T-1042 "Laptop cannot join office Wi-Fi" is
          open and assigned to IT support.

Employee: Please cancel my leave for next week.
Copilot:  That changes your record, so I have asked
          your manager to approve it first.

Notice three different behaviours in three turns: answering from a document, reading a system, and pausing for a person. The rest of the course builds them in that order.

How the job is done today, without the Copilot. Follow one leave question through a company with no assistant:

Step Who What it costs
1. The employee emails or messages the help desk Employee Waits for a reply
2. A help desk agent opens the leave policy and the HR system Help desk agent A search on each message
3. The agent types the answer Help desk agent The same explanation written again and again
4. An unusual case goes to HR Help desk agent, then HR Another round trip

With the Copilot. The employee asks in a chat, the Copilot finds the policy and answers with its source, and a person handles approvals and unusual cases. What is removed is the waiting for a first reply and the retyping of the same explanation. What stays with people is the decision on an exception, the leave balance (which lives in the HR system), approval of any change to someone’s record, and anything HR or IT must be able to explain later. People and the Copilot work together: it takes the searching and typing, people keep the decisions.

What are the modules of the course, and what does each add to the project?

Each module adds one piece to the same project. Use the table to answer “why am I learning this now?”: each module fixes a gap from the three situations above. The last column names the main tool; each is introduced where it is used.

Module What it adds to HelpDesk Copilot Main tool
0. Introduction Project folder, first call Python, an OpenAI-compatible API
1. LLM foundations Test set, terminal chatbot (v0), fixed answer format OpenAI Python library
2. Prompt engineering Main prompt, a chain of prompts, prompt library Plain Python
3. LangChain v0 rebuilt, question sorter, memory, loaded policies LangChain
4. RAG Policy index and cited answers (milestone 1) Chroma
5. Agents and tools Ticket lookup and creation tools LangChain agents
6. LangGraph Routing, saved progress and approval (milestone 2) LangGraph
7. MCP and multi-agent Tools behind MCP, a supervisor and agents (milestone 3) MCP
8. Evaluate, secure, govern Traces, a scored test set, safety rules Langfuse
9. Ship and capstone A chat page, an API, a capstone in a domain you choose FastAPI, Streamlit

Milestone 1 is answers from documents with sources. Milestone 2 is a routed agent: policy questions go to search, ticket questions go to tools, and risky actions wait for a person’s approval. Milestone 3 is several agents working together over a standard connector called MCP. The capstone, built in a domain you choose, is a fictional data pack for banking, healthcare or procurement. Use the brief as your checklist: at each milestone, read it again and tick what the Copilot now does.

The table below turns the three situations into design decisions. Read each row as: a weakness of a model, and the part of the project that answers it.

The gap you saw The design answer Built in
The model invents a policy section Hand it the policy page and make it name the section Module 4
The model cannot see a balance or a ticket Give it tools that read the system Module 5
The model says “done” when nothing happened A tool call is what changes something Modules 5 and 6
Risky actions need a decision A person approves before the change Module 6
A confident tone proves nothing Score the answers on a test set Module 8

Which tools does the course use to build an AI agent, and why?

You will meet a handful of tools. Each earns its place in one module, so you do not need to learn them now. The one-line descriptions follow each project’s own documentation.

Tool What it is Used from
Python and the OpenAI Python library The language you write, and the library that sends requests to a model Module 0
An OpenAI-compatible API One request format that many providers and local servers accept Module 0
LangChain A library for building agents and chains of model calls; its agents are built on LangGraph Module 3
Chroma An open-source store where the policy pages are kept for searching Module 4
LangGraph A low-level framework for long-running, stateful agents, with support for a person stepping in Module 6
MCP An open standard for connecting AI applications to external systems, often compared to a USB-C port for AI Module 7
Langfuse An open-source platform for tracing, debugging and evaluating AI applications Module 8

Other tools appear later as comparisons, so you can see why a choice was made. Each session of the course follows one pattern: where we are, the idea in plain words with one picture, a live demo, a try-it exercise, one project step, a recap and what comes next. When you read these notes alone, treat each part the same way: read the idea, run the example, do the exercise, then answer the recap questions without looking.

How do I set up Python for LLM calls on macOS, Linux and Windows?

Think of a workbench kept just for one job: your own tools in your own drawer, so nothing from another project gets mixed in. A Python virtual environment is that workbench. You check your Python, create the environment, switch it on, and install the one library the course code uses. You run the commands from the folder that holds first_call.py.

On macOS, in the Terminal app:

python3 --version
python3 -m venv .venv
source .venv/bin/activate
pip install openai

On Windows, in PowerShell:

py --version
py -m venv .venv
.venv\Scripts\Activate.ps1
pip install openai

The steps are the same on both systems; the commands differ. The first line shows which Python version you have; the code README says this course’s code needs Python 3.11 or newer, and gives an install command for each system if Python is missing. The second makes the environment (py is the Windows launcher for Python). The third switches it on, and your prompt then shows (.venv). The last installs openai, the one library the code uses. If you would rather not type these, the code folder has a prompt for each system that you can paste into a coding agent such as Claude Code or Codex.

A Windows trap, and the fix. On Windows, PowerShell may refuse the activate script and print “running scripts is disabled”. The Python documentation mentions this case and gives the fix. Run this once, then run the activate line again:

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

It changes the rule for your own user. Under the RemoteSigned rule, scripts you wrote on your own computer can run, while scripts downloaded from the internet need a digital signature.

How do I send my first message to an LLM from Python with an OpenAI-compatible endpoint?

Picture a travel adapter. One plug shape in your hand fits many wall sockets abroad, as long as the sockets follow the same standard. An OpenAI-compatible endpoint is a web address that accepts the same kind of request as OpenAI’s API. Another picture: a phone number format. The dialling is the same whoever you call. Because of this, the same Python code can reach a hosted provider, or a model running on your laptop, by changing the address, the key and the model name. In this course three settings hold that choice:

Setting What it holds
LLM_BASE_URL The address requests are sent to
LLM_API_KEY The key that proves you may use it
LLM_MODEL The name of the model to ask

Compatibility is partial. One hosted provider describes its API as mostly compatible with OpenAI’s client libraries, and a local model server documents that it supports a subset of the OpenAI API. For now, the point is that with a compatible provider you usually write the code once and change only the three settings; check a provider’s own compatibility notes before relying on a feature.

Task A: get a key and set the three values. You need three things from a model provider: its address, a key and a model name. The code README walks through getting a Gemini key: open Google AI Studio’s API key page, sign in, click Create API key, and copy the key. Treat it like a password: do not paste it into a chat, an email or a prompt to a coding agent. Send practice questions: nothing private, nothing from work. Then pick one way to give the script its three settings. Way A is to open first_call.py, where the top of the file looks like this, and paste your key between the quotes:

LLM_BASE_URL = "..."  # already filled in
LLM_API_KEY = ""  # paste your key between the quotes
LLM_MODEL = "gemini-flash-latest"

The LLM_BASE_URL line already holds the Gemini address (shown here as dots), and the model line is already right for Gemini. Way A is fine for practice, but do not share or upload a script with a key in it. Way B is to set the three names in your terminal, so no key is written into a file. On macOS:

export LLM_BASE_URL="<the address already in the script>"
export LLM_API_KEY="<paste your key here>"
export LLM_MODEL="gemini-flash-latest"

On Windows, in PowerShell:

$env:LLM_BASE_URL = "<the address already in the script>"
$env:LLM_API_KEY = "<paste your key here>"
$env:LLM_MODEL = "gemini-flash-latest"

In most shells a setting made this way lasts only for that terminal window, so type them again in a new terminal. If a setting is in both places, the terminal wins, because first_call.py reads each setting from the terminal first and falls back to the value typed in the file. For another provider, use its address and model name from the tables in the code README: the README lists other providers, and for those that accept the same request format these three values are usually all that changes. If Gemini keeps answering with 503 or “overloaded”, try one of them.

Task B: send a first message. With the three values set and the environment on, the script connects to the model service, asks one question and prints the answer. The middle of first_call.py looks like this:

question = "In two sentences, what is a large language model?"
response = client.chat.completions.create(
    model=os.environ.get("LLM_MODEL", LLM_MODEL),
    messages=[{"role": "user", "content": question}],
)
print("Answer:", response.choices[0].message.content)

This is a Chat Completions request: you send a list of messages, each with a role (here user), and read the text of the first choice in the reply. The client above it is created from LLM_BASE_URL and LLM_API_KEY, and each setting is read from the terminal if it is set there, otherwise from the value typed in the file. Run python first_call.py. A key on a paid plan may be charged for usage. Then change the text of question to ask about Fernhill Systems’ leave policy and run it again. Write down: did the reply name a figure or a section number the model could not have known?

What does an LLM reply contain besides the text?

When you open a parcel you read the letter, but the delivery slip tells you how it travelled and what it cost. A model’s reply works the same way: the text is the letter, and the rest is the slip. A reply from a Chat Completions call has this shape. The shape is trimmed and the numbers are made up for illustration:

{
  "choices": [{
    "message": {"role": "assistant", "content": "...reply text..."},
    "finish_reason": "stop"
  }],
  "usage": {"prompt_tokens": 18, "completion_tokens": 64,
            "total_tokens": 82}
}
  • choices[0].message.content is the reply text, and role says who wrote it: assistant. This is what the script prints after Answer:.
  • finish_reason says why the model stopped. The value stop means it reached a natural stopping point; length means it reached the maximum number of tokens set for the reply, so the text may end mid-thought. Other values exist, and a later session meets the one for a tool call.
  • usage counts tokens: prompt_tokens for what you sent, completion_tokens for what the model wrote, and total_tokens for the two together.

On a paid service, these figures are what the provider charges for, so they are worth reading. The next session shows how to estimate them before you send a request. The exact shape can differ between providers, so check your provider’s documentation if a field is missing.

What should I do when my first LLM call fails?

A first run often fails for a small reason, and the message usually names it. Suppose you run python first_call.py and the end of the output is an error containing 401, or the words “Missing or invalid Authorization”: a 401 usually points at the key (empty, wrong or without access). Providers word their error messages differently, so read yours. Match what you see to the table:

You see It usually means Do this
No module named 'openai' The Python you ran cannot find the package: the environment is off, or openai is not installed in it Switch the environment on (the setup steps above), run pip install openai, then run again
An error with 401, or “Missing or invalid Authorization” The key is missing or wrong Paste it again, copied fresh from your provider
An error with 404 The address or the model name is wrong Check both
An error with 429 Too many requests or a limit reached Wait, then try again
An error with 503, or “overloaded” The provider reports it is busy Try again, or switch to another option
Connection refused Nothing is answering at the address; for a local model (Ollama), it is not running Start it

Fix one line at a time and run the script again each time. Settings typed in a terminal last until it closes, so a new terminal starts empty: set them again, or paste them at the top of the script.

What is the project step for this session, and how can I practise?

Project step: create the project folder. In your own workspace, create a folder for the project and a README:

mkdir helpdesk-copilot
cd helpdesk-copilot
mkdir notes

In it, write README.md with three sentences, in your words, on what HelpDesk Copilot will do and for whom. Save your first-call reply in notes/first-call.md; the next session starts from it. The folder you create is the project you grow session by session; the course code is a reference to compare with.

Practice: sort five statements. For each statement, decide whether it describes a chatbot or an agent, and write your reason in one sentence:

  1. “It answers from what it learned in training, and takes nothing from outside.”
  2. “It calls a function to look up ticket T-1042.”
  3. “It creates a ticket and then reports the ticket number it got back.”
  4. “It writes a friendly reply to a pasted email.”
  5. “It repeats a search with different words when the first one finds nothing.”

Flashcards: AI agent and LLM interview questions with answers

Say the answer aloud before revealing it. Speaking is a different skill from reading, so practise both.

1. In one sentence, what does a large language model do? It writes the text that most plausibly comes next, one small piece at a time, based on a very large amount of text it was trained on. It does not look facts up, which is why a fluent reply is not proof of a correct one.
2. Why can the same model sound sure and still be wrong? It writes what is likely, not what has been checked, like a quiz guest who dislikes saying "pass". Researchers argue that training and evaluation reward guessing over admitting uncertainty, so confidence in the tone is no evidence of truth.
3. What is a hallucination, with a Copilot example? A hallucination is a fluent, confident reply that is invented or wrong. An answer citing "Leave Policy 4.9" when no such section exists is one: the specific number makes it sound real, so people may act on it.
4. Name the three gaps of a model alone, from the three situations. It invents a policy it was not given, it cannot see data held in a system such as a leave balance, and it can say it did something it did not do. The fixes are policy search, tools that read systems, and tools that act.
5. What is a tool, in the sense of an agent? A tool is an ordinary function the agent can call, such as a ticket lookup or "create ticket". The model decides when to call it; the function does the real work, which is how an agent reaches facts and changes that a model cannot reach by writing text.
6. How is an agent different from a chatbot? A chatbot writes one reply from the text it has. An agent decides what to do next, calls tools, reads what came back and repeats until the job is done. A chatbot answers; an agent decides, uses tools and acts.
7. What are the steps of the agent loop? Decide which tool to use, act by calling it, observe the result, and then either answer or decide again. The repeat is what lets an agent handle a job that needs more than one step.
8. What does HelpDesk Copilot answer from, and what must it do when the policy is silent? It answers from the company's sample policy files, naming the numbered section, such as Leave Policy 4.2. When the policy does not cover a question it must say it does not know rather than invent an answer.
9. What are the three milestones and when do they arrive? Milestone 1, answers from documents with sources, arrives in module 4 (RAG). Milestone 2, a routed agent with a person's approval, arrives in module 6 (LangGraph). Milestone 3, a multi-agent Copilot over MCP, arrives in module 7 (MCP and multi-agent).
10. What is an OpenAI-compatible endpoint, and why does it help? It is a web address that accepts the same kind of request as OpenAI's API. Because of that, one piece of Python code can reach different providers or a model on your laptop by changing the address, the key and the model name.
11. Which three environment variables does the course use, and what do they hold? `LLM_BASE_URL` holds where requests are sent, `LLM_API_KEY` holds the key that allows the request, and `LLM_MODEL` holds the model name. The key is a secret: the terminal keeps it out of files, and a script with a key pasted in should not be shared or uploaded.

Model answer: what is an agent, how is it different from a chatbot, and what will the Copilot do?

The core question this session answers: “A manager asks: what is an agent, how is it different from a chatbot, and what will HelpDesk Copilot do that a chatbot cannot?”

Three beats a manager listens for, in this order: a chatbot answers · an agent decides, uses tools and acts · what the Copilot does. Skip any of these three and the answer is incomplete.

  1. A chatbot answers: one reply, written from the text it was given and what the model learned, with no way to check or change anything.
  2. An agent decides, uses tools and acts: it chooses a step, calls a tool, reads the result and repeats until the job is done.
  3. The Copilot: answers from policy with the section named, looks up and raises tickets, and asks a person before a risky action.

The full answer, said aloud:

(A chatbot answers) “A chatbot is a model that writes one reply to each message from the text it has. It can sound very sure, but it cannot look anything up and it cannot change anything, so it can invent a policy or say a ticket was raised when it was not.

(An agent decides, uses tools and acts) An agent is a program that uses a model to decide what to do next, calls tools such as a policy search or a ticket lookup, reads what comes back, and repeats until the job is done.

(The Copilot) HelpDesk Copilot answers employees’ questions from the company’s policies and names the section. It looks up and raises tickets through tools, and it asks a person to approve a risky action such as changing someone’s leave record.“

Missing a beat is a failure state. The follow-up question lands where you went quiet: finish without the last beat and the next question is what exactly the Copilot does that a chatbot cannot. Practise until the three come out without prompting, then stop talking and let the questions come.

Why this matters: where do you use what an AI agent is?

In a planning conversation: teams considering an AI help desk want people who can say, plainly, what a model can do alone and what needs tools and company data. The three beats give you a structure with no obvious gap, and a concrete example, a ticket that was or was not really created, makes it believable.

On the job: the first days of any AI project turn on the same things: can your machine call a model, which settings are in use, and where does the answer come from. Setting three values and making a first call are the habits to carry into any project.

In the rest of this course: each session fixes a gap named here. A reader who knows the gaps can predict why each later part exists.

After this unit: what is the assignment and what comes next?

Assignment. Set your three values, send your first message to a model from Python, and create your project folder with its README. The brief itself is the project file. Keep your first-call reply: the next session starts from it.

What’s next. The next session explains how a model works inside: a short history of AI, tokens, the context window and what a call costs. You also write the test set of 10 employee questions with the answers you expect.

Want help building this with someone?

Tell us what you are working on and we will write back about a mentor-led cohort, live sessions or 1:1 training. It is only an enquiry: you choose whether to go further.

Ask about mentor-led training

TechEazy Consulting training material — not affiliated with or endorsed by OpenAI, Anthropic, LangChain or any other company named in this course.