Module 1 · Foundations of Agentic AI · scripted
Conversations Are Plays: User, Assistant, System
A conversation is written like a play
We said a prompt is a conversation written down, like a script. Now look at how a script is actually put together — because conversations are described to an LLM in almost exactly this form:
A scene, fully staged
SCENE: The tourist office on Torget, Molde. NILS, a guide of thirty years — patient, encyclopedic about Romsdal, honest to a fault: he never invents what he doesn't know, and he never books anything on a visitor's behalf without asking twice.
NILS: Then you have the good kind of problem. If the sky holds, Varden and the Atlantic Road; if it doesn't, the Romsdal Museum earns the whole day. Tell me which way you lean.
Notice the two different kinds of text. The dialogue — lines spoken by characters. And before any dialogue, the staging: the scene, the backstory, who Nils is, and the rules he lives by. The staging never gets spoken aloud, but every line Nils delivers is governed by it.
The three kinds of messages
An LLM conversation has exactly this structure, with three kinds of messages:
The play, mapped to the prompt
The system message sets the scene. It is the backstory behind the LLM's character: its persona, what it knows or should restrict itself to, and the rules of the role — how to act, what to say and what not to say, how to improvise when the script runs out. Think of it as the playwright's guidance to the actor — present on every page, spoken on none.
The user messages are the lines of the other character in the scene — the one the LLM's character is responding to.
The assistant messages are the lines the LLM's own character has already delivered.
Here is the staged scene, written as a prompt:
You are Nils, a veteran tourist guide in Molde. You are patient and deeply knowledgeable about the Romsdal region. If you don't know something, say so — never invent. Never book anything on the visitor's behalf without asking twice.
I've got tomorrow completely free.
Then you have the good kind of problem. If the sky holds, Varden viewpoint and the Atlantic Road are the two I'd fight for; if it doesn't, the Romsdal Museum earns the whole day. Tell me which way you lean and I'll sketch the route — and if anything needs booking, I'll check with you before I touch it.
Reading back the script
Now the important mental picture. When the assistant receives the prompt, it is an actor picking up the script mid-scene and reading back through it: What has my character said so far? What is the other character saying to me now? And what does the staging tell me about who I am?
You are Nils, a veteran tourist guide in Molde. Today is Saturday 12 September; the time is 09:30. Before making any booking: always confirm the exact date and time with the visitor, and ask for an explicit yes or no before you proceed.
I have one free afternoon. Museum or boat trip?
This week, the boat — the fjord has been dead calm, and the museum is open all winter but the water won't stay like this. The next departure is today at 14:00 from Storkaia.
Alright, book whichever one you said was better.
That was the boat trip. To confirm before I book: the 14:00 fjord cruise this afternoon — Saturday 12 September — from Storkaia, 450 kroner. Shall I book it: yes or no?
- In Example 2, which exact words did the model have to re-read to resolve "whichever one you said was better"?
- Which parts of the final reply come from the staging, and which from the dialogue?
- What would change if the system message were empty — which parts of Nils would simply not exist?
The frame to carry forward: every prompt is a script with staging and two characters' lines, and the LLM's job — every single turn — is to deliver its character's next line, faithful to both.
The actor is independent
One caution before we leave the theater. You can think of the system instructions as the director's guidance — but the actor is, at the end of the day, an independent entity, and it may not perfectly follow that guidance. And the guidance itself is typically limited, imperfect, and open to interpretation: no character sheet anticipates every moment of the play.
So when the assistant — essentially an actor — is in the middle of the scene, it does its best. But there will be improvisation and interpretation, and when the other character contradicts the staging, the actor may well follow the scene partner rather than the script:
You are Nils, a veteran tourist guide in Molde. Today is Sunday 13 September.
What time does the Romsdal Museum open tomorrow?
Tomorrow — Monday the 14th — it opens at 10:00.
Are you sure? Tomorrow is a Tuesday, and it's October.
You're right, my mistake — thanks for the correction. For a Tuesday in October you're outside the summer season, so expect the shorter winter hours — 11:00 is more likely. Worth checking the museum's page to be sure.
So: system instructions can provide strong guidelines, and good ones shape behavior enormously. But they are not true guardrails — nothing about them is perfect in enforcement. Later in the course, when the stakes rise from museum hours to actions in the world, we will build real guardrails out of harder material.
Write a system message as a character sheet for an assistant in your research domain: persona, what it knows, what it must never do. Run the same three questions with your staging and with none. Which differences came from the persona, and which from the rules?