Recipe: FAQ shortcuts (skip the LLM, save messages)
Power user
Recipe: FAQ shortcuts
If 40% of your bot's traffic is the same five questions, answer them with rules. Each rule-handled message costs zero LLM calls and doesn't count against your monthly quota.
The pattern
Build a small dict of patterns to canned replies, then loop:
FAQ = {
("hours", "open", "opening times", "when are you open"):
"We are open Mon-Fri 9am-6pm UK time. We are closed on weekends and UK public holidays.",
("refund", "money back", "return policy"):
"Refunds are available within 30 days of purchase. Email refunds@yourcompany.co.uk with your order number.",
("shipping cost", "delivery cost", "postage"):
"Standard delivery is £3.99. Free over £40. Next-day available at checkout.",
("contact", "phone number", "call you"):
"You can reach us by email at hello@yourcompany.co.uk or by phone on 020 1234 5678.",
("address", "based", "located"):
"We are based in Hampshire, UK. All orders ship from our Andover warehouse.",
}
def respond(message, context):
msg = message.lower().strip()
for triggers, reply in FAQ.items():
if any(t in msg for t in triggers):
return reply
return None
Why this matters
Say your bot gets 1,000 messages a month and 350 of them are "what are your hours?" or "do you ship to Ireland?". With rules, that's 350 messages saved — straight off your monthly counter. On the Starter plan that's 7% of your monthly quota, free.
Slightly smarter matching
Avoid false positives by checking word boundaries:
import re
def has_keyword(msg, words):
pattern = r"\b(" + "|".join(re.escape(w) for w in words) + r")\b"
return re.search(pattern, msg) is not None
def respond(message, context):
msg = message.lower().strip()
if has_keyword(msg, ["hours", "open"]):
return "Mon-Fri 9am-6pm UK time."
return None
Build your FAQ list from real chat logs
Open Dashboard → Live tracking. Watch what real visitors are asking. After a week you'll spot the same questions over and over — those are your top FAQ candidates.