Lesson 1 · Module 1: System Prompts That Control Agents and Cut Cost
How an AI agent works: model, instructions, tools and memory
- Name the four parts of an agent
- Follow one message through a run
- Know which part you control
Why this matters
Many people connect an AI chatbot to a business inbox and expect it to look after customers. Within a day it quotes a price that does not exist or books a slot that is already full. Every AI agent is built from the same four parts. Once you can name them, you can tell what is missing before a paying client finds the mistake, in any builder: a no-code tool where you build automations by connecting boxes on a screen, Make, Zapier or code.
Key ideas
- The model only reads and writes. The model takes text in and gives text out. It knows language and general facts, but nothing about your business, and it cannot open a calendar or send an email by itself.
- Instructions are a job description. The instructions set the agent's role, goal, rules and reply format. They are sent again with every message, because the model keeps nothing from one call to the next.
- Tools are actions your workflow runs. The model only writes a request, such as "check the calendar for Friday at 9". Your workflow carries out the real action and passes the result back. The agent can only do what you wired up.
- Memory is stored text you send back in. Short-term memory is the messages in the current chat. Long-term memory is customer records and past orders. Both are kept by your workflow, not by the model.
- One business, four parts. Here is how a dental clinic's booking agent breaks down:
| Part | Dental clinic agent |
|---|---|
| Model | Claude or GPT |
| Instructions | "You book cleanings. Never give medical advice. Send emergencies to the front desk." |
| Tools | find free appointment, book appointment, send reminder |
| Memory | this chat's messages, the patient's last visit date |
Try it before you watch
A gym's agent tells a member "Yes, Thursday's yoga class has space!" but the class was full. Which of the four parts was missing, and what would fix it?
Show answerHide answer
A tool, or the facts it needed. The agent had no tool to check class bookings and no class list in its instructions, so it guessed. A "check class spaces" tool that the workflow runs would fix it. This shows that the model only knows what you give it or let it look up.
Words to know
- large language model (LLM): a program trained on huge amounts of text that predicts which words come next. It is the "brain" of the agent.
- system prompt: the hidden instructions the model reads before every customer message.
- tool: one action the workflow can perform when the model asks, like booking a slot.
- workflow: the chain of automated steps that connects the model, the tools and the stored memory.
- hallucination: a confident, well-written answer the model has simply made up.
What to watch for
- Watch the animated diagram of one message moving through all four parts. Notice that the arrow to the tools starts at the model, but the action happens outside it.
- In the short code example, notice that the "model" only returns a request, and the surrounding code does the booking and saves to memory.
- In the common mistake slide, note the two fixes for a guessing agent: put the fact in the instructions, or give it a tool to look the fact up.
Learn it with your tutor on the live board
Key points from the video
A message at two in the morning
- Two in the morning
- Nadia is asleep
- An agent answers in seconds
layout: full
parts:
agent: {chip: "AGENT", sub: "Answers for the shop"}
ask: {chat: "Can I book a Saturday workshop?", reply: "Yes. Seat booked for 10 a.m."}
steps:
- at: "types a question about Saturday"
send: ask
- at: "Nadia is asleep"
note: "Nadia is asleep"
- at: "messages like this arrive"
note: "Messages all night"
- at: "an AI agent reads the message"
highlight: agent
- at: "checks the calendar"
note: "Checks the calendar"
- at: "gets a confirmation"
note: "Seat booked"
- at: "wakes up to a booked workshop"
note: "Morning summary"
- at: "four parts"
note: "Four parts" What you will learn
- Name the four parts of an agent
- Follow one message through a run
- Know which part you control
layout: full
parts:
lesson: {chip: "This lesson", sub: "Three goals"}
steps:
- at: "three goals"
note: "Three goals"
- at: "name the four parts"
note: "Goal 1: the four parts"
- at: "follow one message"
note: "Goal 2: one message"
- at: "know which part you control"
note: "Goal 3: your control"
- at: "Nothing here needs programming"
note: "No programming"
- at: "the candle business"
note: "The candle shop" The model: the brain
- Learned from an enormous amount of writing
- Writes a reply, one piece at a time
- Knows nothing about your prices
layout: full
parts:
llm: {chip: "LLM", sub: "Large Language Model"}
steps:
- at: "what is the model"
highlight: llm
- at: "enormous amount of writing"
vortex: {into: llm, words: [writing, books, articles]}
- at: "writes a reply"
spokes: {of: llm, items: ["Reads text", "Writes a reply"]}
- at: "clever new hire"
note: "Like a new hire"
- at: "knows nothing about your prices"
note: "No facts about your shop"
- at: "other three parts"
note: "Other parts supply the facts" Instructions: the job description
- A block of instructions
- Says who it is
- Sent again with every call
layout: full
parts:
llm: {chip: "LLM", sub: "Large Language Model"}
prompt: {box: "System prompt", holds: [llm], icon: file-text}
steps:
- at: "job description"
note: "A job description"
- at: "a block of instructions"
zoom_out: prompt
- at: "who it is"
spokes: {of: prompt, items: ["Who it is", "Its goal", "Its limits"]}
- at: "its limits"
note: "No refund promises"
- at: "sent again with every call"
note: "Sent with every call"
- at: "short and specific"
note: "Short and specific"
- at: "fills every gap"
note: "Gaps get guessed"
- at: "written briefing"
note: "A written briefing"
- at: "pinned above the desk"
note: "Pinned above the desk" Tools: the agent's hands
- Check the calendar
- Look up an order
- Send an invoice
layout: side
direction: LR
components:
model: {kind: llm, label: "AI model"}
prog: {kind: service, label: "Your automation"}
cal: {kind: external, label: "Calendar"}
ord: {kind: database, label: "Orders"}
inv: {kind: email, label: "Invoice sender"}
zones:
- {label: "Your shop", contains: [prog, cal, ord, inv]}
links: [model->prog, prog->cal, prog->ord, prog->inv]
steps:
- at: "Tools are what let"
show: [model, prog]
- at: "check the calendar"
show: [cal]
- at: "look up an order"
show: [ord]
- at: "send an invoice"
show: [inv]
- at: "never runs these itself"
note: "The model does not run tools"
- at: "asks for one"
flow: ["model>prog: check Saturday"]
- at: "your automation does the work"
flow: ["prog>cal: look"]
- at: "comes back as text"
flow: ["cal>prog: free times", "prog>model: free times"]
- at: "the model replies with the free times"
note: "The reply to the customer" Memory: what the agent can see
- Starts from a blank page
- The chat so far
- A record you keep yourself
layout: full
parts:
llm: {chip: "LLM", sub: "Forgets between calls"}
call: {box: "Each call", holds: [llm]}
steps:
- at: "no memory of its own"
note: "No memory of its own"
- at: "starts from a blank page"
zoom_out: call
- at: "the chat so far"
spokes: {of: call, items: ["Chat so far", "Short-term", "Customer record", "Long-term"]}
- at: "a record you keep yourself"
note: "Long-term: your record"
- at: "looks that record up"
note: "Looks up the record"
- at: "adds it to the prompt"
note: "Added to the prompt" One message, from start to reply
- The message reaches your automation
- The model asks for the calendar
- Saves a note for next time
layout: side
direction: LR
components:
user: {kind: user, label: "Customer"}
prog: {kind: service, label: "Your automation"}
model: {kind: llm, label: "AI model"}
mem: {kind: database, label: "Customer records"}
cal: {kind: external, label: "Calendar"}
zones:
- {label: "Your system", contains: [prog, mem, cal]}
links: [user->prog, prog->model, prog->mem, prog->cal]
steps:
- at: "follow one message from start"
show: [user, prog]
- at: "reaches your automation"
flow: ["user>prog: Can I book Saturday?"]
- at: "the chat so far"
note: "Chat so far"
- at: "a record of the customer"
show: [mem]
flow: ["prog>mem: look up", "mem>prog: record"]
- at: "the model reads it all"
show: [model]
flow: ["prog>model: prompt"]
note: "The model decides"
- at: "asks for the calendar"
flow: ["model>prog: check Saturday"]
- at: "checks the calendar"
show: [cal]
flow: ["prog>cal: Saturday", "cal>prog: free slots", "prog>model: free slots"]
- at: "writes the reply"
flow: ["model>prog: reply", "prog>user: reply"]
- at: "saves a note for next time"
flow: ["prog>mem: save note"]
- at: "two calls to the model"
note: "Two model calls, one check" Common mistake: the model alone
- Treating the model as the whole agent
- Assuming it can send an invoice
- Missing facts and actions must be added as prompt or tool
title: The model alone
underline: red
rows:
- id: idea
text: "The model alone"
- id: fix
text: "Model, prompt, tools, memory"
steps:
- at: "treat the model as the whole agent"
show: idea
- at: "expect the model to remember"
mark: {target: idea, kind: cross, color: red}
- at: "has no calendar"
mark: {target: idea, kind: underline, color: red}
- at: "connected as a tool"
show: fix
- at: "check which of the four parts"
mark: {target: fix, kind: underline, color: green} Recap: four parts, one agent
- The model reads and writes text
- Instructions set the job, tools act
- Memory is what it can see
layout: full
parts:
agent: {chip: "AGENT", sub: "Four parts"}
steps:
- at: "one picture"
note: "The whole lesson"
- at: "reads and writes text"
spokes: {of: agent, items: ["Model", "Instructions", "Tools", "Memory"]}
- at: "knows nothing about your shop"
note: "Needs facts from you"
- at: "Instructions set the job"
note: "Instructions set the job"
- at: "check the calendar"
note: "Calendar, orders, invoices"
- at: "Memory is what it can see"
note: "Memory is what it can see"
- at: "these four parts"
note: "Four parts, one agent" Exercise: map your own agent
- Pick one task
- Name the four parts
- Bring your four boxes
title: Your four boxes
underline: blue
rows:
- id: task
text: "Task: delivery questions"
- id: m
text: "Model: its job"
- id: i
text: "Instructions: the rules"
- id: t
text: "Tools: look up an order"
- id: mem
text: "Memory: what it must see"
steps:
- at: "Pick one task from your own shop"
show: task
- at: "booking a fitting"
mark: {target: task, kind: box, color: blue}
- at: "the model's job"
show: m
- at: "the instructions you would give it"
show: i
- at: "the tools it needs"
show: t
- at: "the memory it must see"
show: mem
- at: "write its name"
mark: {target: t, kind: circle, color: blue}
- at: "a real system prompt"
mark: {target: m, kind: underline, color: blue} Transcript
A message at two in the morning. It is two in the morning, and a customer types a question about Saturday. Nadia is asleep. Her small online business sells handmade candles and runs weekend workshops, so messages like this arrive all night long. This time an AI agent reads the message, checks the calendar and answers in seconds. Behind it is an automation built with a no-code tool such as n8n or Make. This lesson calls it your automation: the chain of connected steps that sits between the customer and the AI model. The customer books a seat and gets a confirmation. Nadia wakes up to a booked workshop and a short note about what happened while she slept. By the end of this lesson you will know how that agent is built, because every agent is made of four parts.
What you will learn. This lesson has three goals. First, you will name the four parts of an agent: the model, the instructions, the tools and the memory. Second, follow one message through a run, from the moment it arrives at your shop to the reply that goes out. Third, know which part you control with the system prompt. Nothing here needs programming. We will use plain words and one shop, the candle business you just met.
The model: the brain. So what is the model? It is a large language model, a program that has read an enormous amount of writing, books and articles, and learned how words usually follow one another. It reads the text you give it and writes a reply, one piece at a time. Think of a clever new hire who has read every guide ever printed but has never seen your shop. Yet the hire knows nothing about your prices, your opening hours, your stock or last week's bookings. Those facts have to come from somewhere else, and that is what the other three parts are for.
Instructions: the job description. Now give the model a job description. This is the system prompt, a block of instructions that the model reads before any customer message arrives. It says who it is, its goal and its limits, such as never promising a refund without asking Nadia. The instructions are sent again with every call. A call is each time your automation sends text to the model and gets a reply back, so the rules are always in view. Keep them short and specific. Vague instructions give vague behaviour, and the model fills every gap with its own guess. Think of a shop manager's written briefing for a new assistant, pinned above the desk, and read each morning before the phone rings.
Tools: the agent's hands. Tools are what let the agent act, and they are the agent's hands. A tool is an action that your automation can perform, such as check the calendar, look up an order, or send an invoice. In a no-code tool such as n8n or Make, each tool is one box you connect to the calendar, the orders list or the invoice sender. The model never runs these itself. It only asks for one, by name and with the details filled in, and your automation does the work. The result comes back as text, and the model reads it before writing the reply the customer sees. So a booking looks like this: the model asks to check Saturday, your automation looks at the calendar, and the model replies with the free times.
Memory: what the agent can see. Here is the part that surprises most people. The model has no memory of its own between calls. Every time a message arrives, it starts from a blank page and sees only what your automation puts in front of it, nothing more. Short-term memory is the chat so far, sent back along with the new message. Long-term memory is a record you keep yourself, such as the customer's name, past bookings and a note that they prefer mornings. Your automation looks that record up and adds it to the prompt, so the agent seems to remember, because the record does.
One message, from start to reply. Let's follow one message from start to finish. First, the message reaches your automation, which builds the prompt from the instructions, the chat so far and a record of the customer. Second, the model reads it all and decides it needs free times, so it asks for the calendar. Third, your automation checks the calendar and returns the free slots as text. Fourth, the model writes the reply, and your automation sends it and saves a note for next time. One message, two calls to the model, one tool check and one reply.
Common mistake: the model alone. The most common mistake is to treat the model as the whole agent, as if the engine were the whole car. People write one clever sentence, expect the model to remember last week's customers, and then wonder why it cannot send an invoice. The model has no calendar, no invoice sender and no drawer of past orders. It only sees the text in front of it. If a fact or an action is not in the prompt or connected as a tool, the agent does not have it. The fix is simple: check which of the four parts holds each job before you blame the model.
Recap: four parts, one agent. Let's put the whole lesson together in one picture. The model reads and writes text, so it is the brain of the agent, but it knows nothing about your shop. Instructions set the job, and tools act: the tools let it check the calendar or send an invoice. Memory is what it can see, the chat so far and the records your automation gives it. Every agent you build will be these four parts working together, and the rest of this module teaches you to shape each one.
Exercise: map your own agent. Before the next lesson, do one small exercise with a pen or a document. Pick one task from your own shop, such as answering delivery questions or booking a fitting. Then name the four parts in boxes: the model's job, the instructions you would give it, the tools it needs and the memory it must see. Be specific. If a tool is needed, write its name, like look up an order. Bring your four boxes to the next lesson, because we will turn them into a real system prompt that you will later test.
Explore the animations
The animations from the video, exact and live: play them, pause, drag the slider or jump to a step at your own pace.
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Answer every question, then check. 70% passes; you can retry as often as you like.
Lesson summary
- Reading
- Video watched
- Quiz passed (70%)
- The model reads and writes text
- Instructions set the job, tools act
- Memory is what it can see