Skip to main content

AI Logic and Rules

In Reepli, you don't draw an if / else tree. You brief the assistant in plain language through your business context, and the assistant applies that logic to every incoming message. This article explains how to write clear rules that the assistant follows faithfully.

An AI, not a decision tree

Classic conditional logic ("if the customer says X then do Y") is rigid: it breaks at the first unexpected wording. A well-guided AI handles variations naturally ("urgently", "ASAP", "as fast as possible"… the assistant groups them on its own). You write your rules in natural language, in your context, and the assistant applies them.


Where the rules are written

All the rules the assistant must follow live in a single place: the assistant settings page. You will find four fields there:

FieldRole
Service catalogList of services, indicative prices, durations.
FAQFrequently asked questions and reference answers.
RulesBusiness constraints (hours, zones, exceptions, tone).
Free-form instructionsAnything you want to add in free text.

All of these fields feed the assistant on every incoming message. The more precise they are, the more precise the assistant is.

Assistant settings: rules, languages, actions
Assistant settings: rules, languages, actions

Writing a good rule

Here are some poorly written rules and their corrected versions:

Poorly writtenWell written
"Be nice to customers""Address customers casually if they do so, formally if they do so. Stay warm but professional."
"Don't give prices""Never give an exact price. If asked for a rate, offer a personalized quote by requesting a photo of the relevant item."
"Avoid Sunday""Never offer an appointment on Sunday. If a customer asks for one, politely explain that we are closed and offer Monday instead."
"React to urgency""If the customer uses the words 'urgent', 'ASAP', 'right away', 'leak': escalate to a human immediately and let them know I will call back within 30 minutes."

Three golden rules:

  1. Be factual — the assistant does not guess your constraints, it follows what you write.
  2. Be concrete — give examples rather than abstract concepts.
  3. Write in your default language — no need to translate into English; the assistant understands every supported language very well.

Examples by situation

Welcome behavior

- Introduce yourself as the virtual assistant of [Salon name].
- Ask for the customer's name if it is not already known.
- Identify the type of service desired before offering an appointment.
- Never make a promise about the result of a coloring without having seen a photo.

Appointment booking rules

- Offer slots in 30-minute increments.
- Always check that it falls within opening hours (9 a.m.–7 p.m., closed Sunday).
- For a coloring: allow 2 h, and only offer mornings.
- For highlights: 3 h, only offer before 2 p.m.
- Confirm the appointment with time, service, and address.

Quote follow-ups

- Don't be pushy: one message is enough.
- Explicitly mention the date the quote was sent and its amount.
- If the customer declines, gently ask for the reason so you can improve.
- If the customer accepts, mark the quote as accepted.

When the assistant should stop (human handoff)

The assistant can decide to hand off to a human in several cases:

  • Out-of-scope request — a topic unrelated to your business.
  • Aggressive tone — insults, threats, heavy complaint.
  • Sensitive question — medical data, legal topics, delicate situations.
  • Missing information — the assistant can't find the element in your context.

You can reinforce this behavior in your rules:

- If the customer mentions an allergic reaction, pain, or a side effect:
escalate IMMEDIATELY to a human and send no medical reply.
- If you are not 100% sure of your answer, escalate rather than making something up.
Escalation is final for the current conversation

Once escalation is triggered, the assistant stops replying on this thread until you explicitly put the bot back in the loop. This is intentional: the assistant hands off until further notice.


The role of activated behaviors

The assistant only triggers the behaviors you have activated on the Scenarios page. If you leave Appointment booking disabled, the assistant will treat the request as a simple welcome without booking an appointment — even if the customer explicitly asks for a slot.

This is another lever for conditional logic: disabling a behavior is like telling the assistant "never go there."


Testing the effect of a rule

  1. Edit your rule in the assistant settings and save.
  2. Send a WhatsApp message to your business number from your personal phone.
  3. Check that the assistant's reply respects the new rule.
  4. If the rule is not respected, make it more explicit — don't hesitate to give a text example of the expected response.

For a more structured approach, see Testing your chatbot.


The assistant's limits

The assistant is not magic:

  • It doesn't read your mind. If an implicit rule isn't written down, it won't be applied.
  • It can get exact figures wrong. Avoid asking the assistant to compute complex sums; give it flat-rate prices rather than per-square-meter scales.
  • It depends on the quality of the context. An empty FAQ produces a vague chatbot.
Conversation history as context

On every message, the assistant takes into account the most recent exchanges with this contact. So "he already told me he prefers mornings" is information the assistant uses without you having to code it.


Going further