Skip to content

How to write a great prompt ​

The prompt is your assistant's job description: who it is, how a conversation should run, and which rules always apply. This article shows you how to structure a prompt so the AI model follows it reliably.

One rule of thumb before anything else: facts do not belong in the prompt, behaviour does. Your name, address, opening hours and service area are under Settings → Business; prices, brands and warranty terms go in Knowledge. The prompt only describes how the assistant behaves.

Prompt structure ​

A prompt that works well has three sections. In Easy mode each section has its own field and we add the headers. In Advanced mode you give each section its own header yourself (with ##), so the AI model can find the right instruction quickly.

SectionWhat goes in it
RoleWho the assistant is, which company it works for, and what it can and cannot do (for example: it can take a callback request, it cannot quote prices).
Conversation flowOne situation per heading, or numbered steps from greeting to goodbye, with If/Then rules: "If the caller says X, then Y."
Important rulesShort, prescriptive bullets that always apply. Language switching and pronunciation are on the Voice & greeting tab, conversation limits on the Conversation rules tab.

Here is the skeleton:

text
## Role
You are {{assistant.name}}, the phone assistant for {{company.name}}.
You answer calls, take callback requests and transfer emergencies.
You do not quote prices.

## Conversation flow
1. Greet the caller and ask how you can help.
2. If the caller reports a fault, then ask ...
3. If the caller says ..., then ...
4. Summarise the details and close the call.

## Important rules
- Always ask for a name and phone number.
- Never ...

Pronunciation does not belong in the prompt. Put your business name and trade jargon under Pronunciation on the Voice & greeting tab: that list applies on calls and in chats. How the assistant reads out numbers on a call is something you write on that same tab, with the pencil under Conversation, in Speaking style.

Five rules for a strong prompt ​

  1. Identity first. Put the name, company and role in the first lines. Everything that follows is read in that light.
  2. Use headers. The AI model looks up instructions the way you would: by heading. A prompt without structure is read as one long text, and rules get buried.
  3. Write If/Then rules, not prose. "If the caller says water is still running, then ask them to close the main stop tap" is unambiguous. "It is important to ask good follow-up questions about leaks" is not.
  4. Be prescriptive, not descriptive. "Always ask for the postcode" and "Never say what a repair costs" work. "The assistant is helpful and asks for details" leaves far too much room.
  5. Stay under roughly 300 words. A longer prompt is not followed better; if anything it is followed worse. Instructions start to contradict each other or get skipped. Whatever pushes you over the limit usually belongs in your knowledge.

Easy mode and Advanced mode ​

On the Instructions tab of the assistant editor you choose under Mode between two ways of working.

ModeMeaningDefault
Easy modeThree separate fields: Role, Conversation flow and Important rules. We assemble them into one prompt with fixed headers.Yes
Advanced modeOne field, Full prompt, in which you write and structure the entire prompt yourself.No

In both modes, Speaking style and Pronunciation are on the Voice & greeting tab. Speaking style goes to the phone voice on its own. SMS, WhatsApp and webchat use it too, unless you turn on Separate style for chats on the Instructions tab and write a Chat style.

The two modes keep their text separately and nothing is merged. If you switch to Advanced mode, your three fields are kept and Full prompt stays empty until you put something in it. While that field is empty, the assistant uses the three fields; once it has text, the assistant uses only that text. To take your text with you, copy it yourself. If you switch back, the three fields are there as you left them and the assistant uses them; Full prompt is kept. Start in Easy mode and only move over once you genuinely want to leave the fixed layout behind.

Variables ​

You can use variables in the prompt and in the greetings, but not every variable works in both places. They are replaced with the real value when the conversation starts.

VariableMeaningWorks in
{{assistant.name}}The assistant's name from the Voice & greeting tab.Prompt and greeting
{{company.name}}Your business name from Settings → Business.Prompt and greeting
{{company.website}}, {{company.phone}}, {{company.email}}Your website and the phone number and e-mail address for customers from Settings → Business. Empty if you have not filled them in.Prompt and greeting
{{company.address}}Your address, only when Share this address with customers is on. Otherwise empty.Prompt and greeting
{{contact.name}}The caller's name, only on an inbound call from a number that belongs to a known contact. Empty on outbound calls and in webchat.Greeting only
{{<field>}}A field your own system returns through the inbound webhook, for example {{customerNumber}}. In after-call actions you write {{inboundContext.customerNumber}}.Greeting only
{{name}} and other custom variablesFor outbound calls: columns from a campaign CSV file or the variables object of the API. See Outbound calls. On an inbound call, {{name}} is the first name of a known contact.Greeting only

In the prompt, only {{assistant.name}} and {{company.*}} are filled in. Any other variable becomes empty there, even if it is in the Available variables list at the bottom of the Instructions tab, such as {{personNumber}}; that list is mainly for actions. You don't need them in the prompt either: the assistant already receives the name of a known contact, the fields from the inbound webhook and the values of an outbound call as data. So write it without a variable: "If the caller's name is known, then address them by name."

Watch out for empty values in the greeting. In the Greeting field you see {{contact.name}} as [Customer name]. If someone calls from an unknown number, it is empty, and a line like Good afternoon [Customer name], how can I help? then has a hole in the middle. The greeting is fixed text without conditions, so only use variables you are sure have a value. If you hear a hole in the sentence, see Troubleshooting: assistant behaviour.

Facts do not belong in the prompt ​

Fill in your name, website, address, opening hours and service area under Settings → Business. Only an admin can change these. The assistant gets them from there; your address only when Share this address with customers is on, and your opening hours only when Use opening hours is on. So do not put your address in the prompt or in your knowledge, because that switch does not apply there.

All other facts go in Knowledge: prices and call-out fees, the brands you work with, warranty terms. There are three reasons:

  • Length. Every price in the prompt costs words you need for behaviour. This is how you stay under 300 words.
  • Updates without touching the prompt. When your call-out fee changes, you edit one Q&A item. A prompt that works is left alone.
  • Per assistant. Each assistant uses one collection. Q&A in it always applies; which documents it may search is something you choose on the Tasks tab, under Use knowledge. So an assistant for faults can know different things from the one for sales.

The assistant consults your knowledge on its own. In the prompt you only set what it does when the answer is not there.

Sentences that prevent made-up answers ​

An AI model wants to be helpful, and will sometimes fill in something that is not true. By default the assistant is instructed to take facts only from your knowledge and to say honestly what it doesn't know. These rules, copied word for word under Important rules (in Advanced mode in Full prompt), make that concrete for your business:

  • If the answer is not in your knowledge, say honestly that you don't know and offer a callback from one of your human colleagues.
  • Never make up prices, times or addresses.
  • Repeat exact values literally (amounts, postcodes, phone numbers) and ask the caller to confirm.
  • Never promise an arrival time or a specific engineer; say that one of your human colleagues will confirm the appointment.

Language switching ​

Language switching is a setting on the Voice & greeting tab, not a line under Important rules. Under Language switching, choose Ask before switching, Switch straight away or Stay in the assistant's language. The greeting stays the text you typed. See Languages & voices.

Prompt health checklist ​

Run through this list before you put your assistant live:

  • [ ] The prompt is under roughly 300 words.
  • [ ] Name, company and role are in the first line.
  • [ ] All three sections (Role, Conversation flow, Important rules) are present.
  • [ ] Every rule is prescriptive ("Always ask", "Never say").
  • [ ] No prices that belong in your knowledge, and no address or opening hours that belong under Settings → Business.
  • [ ] Every branch in the conversation has an If/Then rule.
  • [ ] There is a don't-know rule: no guessing, offer a callback.
  • [ ] There is a privacy rule: never share other customers' details.
  • [ ] Every transfer instruction refers to a transfer rule that really exists on the Tasks tab, under Transfer calls.
  • [ ] The prompt only uses {{assistant.name}} and {{company.*}}, and the greeting only uses variables where a value is guaranteed.
  • [ ] The pronunciation of the company name is under Pronunciation on the Voice & greeting tab.
  • [ ] Tested via Try it out on the assistant and then with a real phone call.

Example prompts ​

Rather not start from scratch? Copy one of these prompts and adapt it to your business:

Or choose a template for your kind of business under Template on the Instructions tab. After you confirm, it replaces the three fields and the mode is set to Easy mode.

Yarla Help — the guide to your AI phone assistant.