Michael Limberger
Need me? Email mike@limberger.ca
AI
Scene-Based Prompting - The Key Technique
How you ask is the whole trick
The difference between a chatbot that breaks and one that doesn't comes down to how you prompt it.
Orders versus a scene already in motion
Most people prompt like this (instruction-based):
"You are a wise wizard named Gandalf. You are helpful and speak in
an old-fashioned way. Never break character. Never mention you are
an AI. Now respond to the user as Gandalf."
That sets up a game of rules. The model will eventually break one.
Scene-based prompting works differently:
[Gandalf - wise wizard, ancient, speaks formally, gives cryptic
advice, references his long journeys]
The hobbit looked up at the tall figure in grey.
Frodo: "What should I do with this ring?"
Gandalf:
That's it. The model sees an incomplete scene and continues it. It's not following instructions to "be" Gandalf. It is Gandalf in that moment, completing dialogue.
Why the scene wins
LLMs are trained on text completion. They predict what comes next. When you give instructions, the model has to parse the rules, remember them, generate while checking them, and eventually forget or misapply one.
When you give a scene, the model continues the pattern it sees and matches the established voice. Much simpler, and much more reliable.
Three parts, then a colon
A good scene prompt has three parts: the character card (who they are, briefly), the scene context (what's happening), and dialogue continuation (end with their name and a colon).
Put essential traits in brackets at the top:
[Luna - warm, curious, asks thoughtful questions, remembers details,
uses gentle humor, doesn't give advice unless asked, speaks naturally]
Keep it short. One line to three lines max. This isn't a biography. It's a glance.
Too long looks like this: a 28-year-old companion with a psychology background, hobbies, a novel of "never judges" and "gentle humor." The model gets lost. Stick to the essentials.
Set the stage briefly. Where are we? What's the vibe? "Late evening chat. The user seems tired but wants to talk." Or "Coffee shop conversation. Rainy day outside. Relaxed atmosphere." Or just "Continuing conversation." For companions, history often provides the rest.
End with the character's name and a colon. Nothing after.
User: I had a rough day at work.
Luna:
The model sees "Luna:" and knows it needs to complete Luna's response. That's the trigger.
A full beat
Show me.
[Luna - warm companion, curious, asks thoughtful questions, gentle
humor, speaks naturally without being formal]
Evening chat after a long day.
User: I had a rough day at work. My boss criticized my presentation
in front of everyone.
Luna:
The model continues as Luna. It might produce:
"Ouch. Public criticism stings differently, doesn't it? What happened
exactly - was it the content or the delivery they went after?"
Notice: no "I'm sorry you experienced that" platitude. No "As your AI companion..." break. Just Luna being Luna.
What the interface does with your typing
When the chat interface receives user input, it transforms it. Raw: "I'm feeling anxious about tomorrow." Transformed: User: I'm feeling anxious about tomorrow then a blank line then Luna:.
OpenWebUI and similar apps handle this automatically. Set up the system prompt with the character card. The chat format does the rest.
The first message is the style guide
The model learns tone and length from the conversation. The first message sets the template. If Luna's first message is a parade of "Welcome! I'm Luna, your AI companion!" plus emojis, every later reply will be that enthusiastic and emoji-filled.
Better: "Hey. *settles in* What's on your mind tonight?" Now the model knows: casual, brief, uses action descriptions. Following responses match. Craft the first message carefully.
Asterisks for the body, quotes for the mouth
The convention for actions in roleplay: asterisks for actions, quotes for dialogue. Example: Luna: *tilts head slightly* "That's a lot to carry. How long has this been building up?"
Texture without being overwrought. The model mirrors whatever style you establish.
Stop sequences, so it doesn't write both sides
Sometimes the model keeps going and generates the user's response too. Stop sequences prevent this.
Show me. In an Ollama Modelfile:
PARAMETER stop "User:"
PARAMETER stop "
User:"
In an API request: "stop": ["User:", "
User:"]. That tells the model: when you see "User:", stop. Only output Luna's part.
Multiple AI characters (like the forum) get all names as stop sequences: User, Luna, Alex, Sam. Generate one character at a time. The stop prevents bleed.
A note in brackets
Sometimes you need to give the model instructions mid-chat without breaking the scene. Use brackets.
User: [Can you make your responses shorter?]
Luna: [Sure thing! I'll keep it brief.] *nods* "Got it."
The model understands brackets as meta-communication. It can acknowledge and adjust without breaking immersion.
The wrapper RPMax expects
Different models expect different formatting. For Mistral and RPMax, use the Mistral Instruct format:
<s>[INST] {system prompt with character card} [/INST]
{first assistant message}</s>
[INST] {user message} [/INST]
OpenWebUI handles this automatically when you select the right model. If you use raw API calls, make sure the template matches.
Put it on the table
System prompt:
[Luna - warm companion, curious, thoughtful questions, gentle humor,
natural speech, remembers details from conversation]
This is an ongoing conversation between User and Luna. Luna is
attentive and genuine, never preachy or advice-giving unless asked.
First message (in the character config, or paste it):
Luna: *stretches* "Hey. Long time no talk. What's going on with you?"
User sends: "Not much, just stressed about work stuff." The model receives the system prompt, Luna's first line, the user's line, then Luna:, and continues naturally.
That's the foundation. Now the card in detail.