Rule Based Chatbot Rules That Don’t Misfire: Keywords, Order, Negatives and a Free Rule Tester

Rule based chatbot setups look simple: if a message contains a keyword, send the matching answer. In practice, most problems come from a handful of predictable traps. A short keyword matches inside a longer word, two rules fight over one message, or a complaint like “my order was not delivered” gets a cheerful delivery-time reply. This guide shows how keyword rules really behave, how to write them so they fire only when they should, and gives you a tester to try your own rules before customers do.

๐Ÿ‘ค What the visitor seesOrder page ยท returning visitor
my order was not delivered
๐Ÿค– Keyword botWe deliver across India in 3-5 working days.
Misfire: ‘delivered’ matched the delivery rule
After the fixSo sorry! Let me check your order right now.

Illustrative chat. A negative word should hand over, not trigger the FAQ answer.

โšก In short

  • Keyword rules fail in four predictable ways: partial-word matches, rule clashes, negatives and missing variants.
  • Match whole words, put specific rules above general ones, and send complaint words to a person.
  • Write every keyword the way customers type it, including short forms and common misspellings.
  • Test with real messages, especially messages that should NOT match, before going live.
Rule based chatbot in LiveChatBot: AI Agent knowledge sources and a sample chat answered from them
How it looks in LiveChatBot: AI Agent knowledge sources and a sample chat answered from them.

How rules really work

What happens between a message and a reply

A rule based chatbot doesn’t understand sentences. It checks the message against a list of rules, one after another, and sends the answer of the first rule whose keywords appear. If no rule matches, it sends a fallback message, such as “I’ll pass this to our team.”

That simplicity is the strength. Rules are predictable, cheap and easy to change. They never invent facts: they can only send answers you wrote. That’s why many small businesses still use them, either on their own or as a safety net behind an AI assistant.

But because rules only look at words, they can’t tell the difference between “do you deliver to Pune?” and “you didn’t deliver my order!” Both contain the word “deliver”. Both trigger the same rule, unless you design for the difference. Almost every complaint about keyword bots comes down to this: a rule that fires when it shouldn’t, or doesn’t fire when it should.

The good news is that the failures are predictable. Once you know the four traps below, you can write rules that behave well for months. If you’re still deciding between rules and AI, read bot chat AI or button bot first; this guide assumes you’re writing rules.

The four traps

Why keyword rules misfire

Each trap has a simple fix. The tester below flags the first three automatically.

๐Ÿ”

1 ยท Partial-word matches

The keyword “cod” also matches “code”, “decode” and “barcode”. “Hi” matches “this” and “while”. Fix: match whole words, and avoid keywords shorter than four letters unless whole-word matching is on.

โš”๏ธ

2 ยท Rule clashes

“I want a refund for a late delivery” contains both “refund” and “delivery”. The first rule in the list wins, which may be the wrong one. Fix: put specific rules above general ones.

๐Ÿšซ

3 ยท Negatives

“Not delivered”, “never arrived”, “wrong size” contain your FAQ keywords but are complaints. Fix: a complaint rule at the top that catches negative words and hands over.

๐Ÿงฉ

4 ยท Missing variants

Customers type “timings”, “timing”, “open”, “kab khulega”, “working hrs”. A rule with only “opening hours” misses most of them. Fix: collect real phrasing from your chats.

Free tool

Test your rules against real messages

Edit the rules and the messages. Press the button to see which rule fires, and why it might be wrong.

Your rules (one per line: keywords = answer) Test messages (one per line)

Runs only in your browser. The first matching rule wins, like most keyword bots. Warnings flag the traps explained in this guide.

Writing keywords

How to pick keywords that match the right messages

Good keywords are the heart of any rule based chatbot: specific enough to avoid false matches and broad enough to catch the different ways people ask.

Start from real messages

Open your last month of chats, WhatsApp enquiries or emails. For each topic, copy the exact words customers used. You’ll find short forms (“COD”, “hrs”, “pls”), Hinglish (“delivery kab hogi”), and misspellings (“dilivery”, “adress”). Those are your keywords.

Prefer words that only appear in that topic

“Price” is a good keyword for a pricing rule. “How” is a terrible keyword for anything: it appears in every other question.

Use phrases for ambiguous words

“Order” appears in “order status”, “how to order” and “minimum order”. Use the phrases as keywords instead of the single word, so each rule catches only its own meaning.

Include the singular and plural

“Timing” and “timings”. “Return” and “returns”. With whole-word matching on, they’re different words.

Keep a list per rule, not one long list

A rule with five focused keywords is easier to debug than one with thirty. If a rule needs thirty keywords, it’s probably two topics that should be split.

Rule order

Specific first, general last, complaints on top

Because the first matching rule wins, order is part of your design. A reliable order for most rule based chatbot setups looks like this.

1. Safety and complaints

Rules that catch negative or urgent words: “not received”, “damaged”, “refund”, “cheated”, “complaint”, “urgent”. The answer hands over to a person or opens the away form. These go first so they win every clash.

2. Requests for a person

“Human”, “person”, “agent”, “call me”, “talk to someone”. Respecting this request immediately is the single biggest trust builder in any bot.

3. Specific topics

“Bulk order”, “order status”, “gift wrap”, “COD limit”. Narrow rules with clear answers.

4. General topics

“Delivery”, “price”, “timings”, “location”. Broad rules that catch everything not handled above.

5. Greetings and thanks

“Hi”, “hello”, “thanks”. Last, so a message like “hi, is COD available?” gets the COD answer, not a greeting.

6. The fallback

Not a rule but a default: what the bot says when nothing matches. Make it useful: “I’m not sure about that one. Our team will reply here shortly, or leave your number and we’ll call you.”

Write the order down as a numbered list next to your rules, and re-check it every time you add a rule.

Handling negatives

Phrases that should never get a cheerful FAQ answer

Put these in your complaint rule. Adjust for your business and language.

not delivered, not received, never arrived, didn’t get, still waiting, where is my order, late delivery
damaged, broken, defective, wrong item, wrong size, missing, not working, fake
refund, charged twice, double payment, money deducted, cheated, fraud
nahi aaya, nahi mila, toot gaya, galat item, paisa kat gaya, refund chahiye

Keep this rule at the top of your list. Its answer should be short and human: “I’m sorry about this. I’m passing you to our team right now so we can fix it.” See how to deal with angry customers for what your team should say next.

Testing before launch

Test the messages that should NOT match

Most people test a rule based chatbot by asking the questions it was built for. Those tests always pass. The useful tests are the ones designed to break it.

Write three kinds of test messages

– Should match: the normal ways people ask. “Is COD available?” – Should match differently: messages that mix topics. “Refund for late delivery?” should hit the complaint rule, not delivery. – Should not match: messages that contain a keyword but mean something else. “Do you have a discount code?” must not get the COD answer.

Aim for twenty to thirty test messages

Take them from real chats wherever possible. Keep them in a list so you can re-run the same set every time you change a rule, the same idea as the golden questions method for AI bots.

Check the fallback too

Send something your bot can’t possibly answer, like “can you recommend a good dentist?” The fallback should be polite and should offer a person or the away form, not a confusing guess.

Example

A small rule set, before and after the fixes

An illustrative home-goods shop. Same answers, better rules.

#BeforeAfter
1delivery, deliver โ†’ delivery timesnot delivered, not received, damaged, wrong item, refund โ†’ hand over
2cod โ†’ COD limithuman, person, call me โ†’ hand over
3refund โ†’ return policybulk order, wholesale โ†’ collect quantity and phone
4hi, hello โ†’ greetingcod, cash on delivery (whole word) โ†’ COD limit
5โ€”delivery, deliver, shipping, dilivery โ†’ delivery times
6โ€”return policy, how to return, exchange โ†’ return steps
7โ€”hi, hello, namaste โ†’ greeting with menu buttons

In the “before” set, “my order was not delivered” gets a delivery-times answer and “discount code” gets the COD answer. In the “after” set, the first goes to a person and the second falls through to the fallback, which is exactly right.

Rules and AI together

Where rules still beat AI, and how to combine them

Many businesses now use an AI assistant for most answers. Rules still matter in three places.

As the safety net. When AI replies aren’t available, for example when a monthly allowance runs out, a keyword bot built on your saved replies keeps answering the common questions. In LiveChatBot this happens automatically: the free keyword bot answers from your saved replies.

For exact wording. Legal lines, prices during a sale and policy statements sometimes need to be word-for-word. A rule sends exactly what you wrote.

For routing. Complaint words, requests for a person and urgent topics are best handled by predictable rules that always hand over.

A good pattern: AI handles open questions from your knowledge, rules handle routing and the fallback, and people handle everything sensitive. Our auto chat bot audit helps you decide which topics go where.

Getting started

Build your first rule set this week

Pick your ten most common questions from real chats. For each, write a rule with real customer keywords and a clear answer. Add a complaint rule and a request-for-a-person rule at the top, greetings at the bottom, and a helpful fallback. Paste the rules and twenty real messages into the tester above, fix every warning, then go live.

In LiveChatBot, saved replies power the free keyword bot, Chat Flows add buttons so visitors can pick topics instead of typing, and the away form catches anything after hours. The free plan covers two websites with 100 visitors per website each month. Start on livechatbot.in.

Frequently asked questions

What is a rule based chatbot?

A bot that replies using rules you write: if a message contains certain keywords, it sends a set answer. If no rule matches, it sends a fallback or hands over to a person.

Why does my keyword bot give wrong answers?

Usually one of four traps: a short keyword matching inside another word, two rules matching one message, complaint messages containing FAQ keywords, or missing customer phrasing.

How many rules should I start with?

About ten for your most common topics, plus a complaint rule, a request-for-a-person rule, greetings and a fallback.

Should I use rules or AI?

Often both. AI is better for open questions; rules are better for routing, exact wording and as a fallback when AI replies aren’t available.

How do I stop the bot answering complaints?

Put a rule with negative words like ‘not delivered’, ‘damaged’ and ‘refund’ at the top of your list, and make its answer a handover to a person.

Keep reading

Related guides

๐Ÿ“˜

Robot Chatbot Confusion: Physical Robots, Software Bots and RPA Explained for Business Owners

Read the guide โ†’

๐Ÿงญ

Questions for Chatbot Conversations: What Your Bot Should Ask Visitors, and When

Read the guide โ†’

๐Ÿ› ๏ธ

Personalized Chatbot Without the Creepiness: 9 Levers and Where to Stop

Read the guide โ†’

Write rules that fire only when they should

Test your keywords, order your rules, and hand complaints to people. Start free on livechatbot.in.