A help centre AI that only answers from the docs.
Grounding a public support assistant: what it can't see, current facts that beat stale docs, no false promises, and checking what reaches the model.
The Laayo Help Center has an "Ask Laayo AI" box. Anyone can use it, with or without the app or an account. It answers questions about ordering, delivery, payments and the app, from the same knowledge base that powers the support chat inside the app.
A public assistant has a different job from an in-app one. It can't see any account, order or payment. Nobody from the team reads its chats. And it is on the open internet, so someone will try to use it for homework. Most of the design is about telling the model those limits plainly, then checking that it follows them.
The prompt says what it cannot do
The system prompt is short and mostly about limits:
- You cannot see any account, order, payment, wallet or refund. Never pretend to look something up, and never say you checked, updated, cancelled or refunded anything.
- There is no person on this chat, and nothing you write reaches the team. Never say "I will escalate", "our team will review" or "hang tight".
- For anything about a specific order, payment, refund, account problem, missing OTP or safety issue, send the visitor to Help & Support in the app, or to the support email.
- Never invent prices, fees, restaurant names, timings, promotions or policies that are not in the knowledge base. If you don't know, say so.
- Never ask for or accept a password, OTP, PIN or card number, and warn the visitor if they share one.
- Only answer questions about Laayo. Decline anything else in one sentence.
- Reply in the visitor's language and script: English, Nepali in Devanagari, or Nepali typed in English letters.
- Stay under 110 words, in plain sentences, with at most four short bullets.
The no-escalation rule came from a real mistake in the in-app chat. Its knowledge base was written when the chat could hand off to a person. It had a matrix of escalation cases and lines like "an agent will be with you shortly". Later, handoff to people was switched off and the system prompt was updated to say there was no human. The knowledge base wasn't. The model followed the knowledge base, told a customer it would escalate their problem, and the escalation marker it produced was quietly dropped because handoff was off. No alert went anywhere.
The fix touched both texts. The prompt bans the phrases outright, and the knowledge base got a header that redefines what "escalate" means. The public Help Center prompt adds one more line: wherever the knowledge base says to hand off, follow the instruction above instead.
Current facts beat old documents
Documentation goes stale faster than prompts. The knowledge base still mentioned an older set of cities and payment options, and rewriting it is a big job. So the prompt has a CURRENT FACTS section that sits above the knowledge base and is labelled as overriding it. The facts are a short list, editable in the admin panel, so a change in what is live is a text edit, not a deploy.
The prompt is assembled in a fixed order: system rules, current facts, knowledge base, the last few turns of the chat (each trimmed), then the visitor's message.
Check what actually reaches the model
The quietest failure in the in-app chat was length. The knowledge base file was around 40 KB, and the code cut it to 12,000 characters before sending it. Everything after the cut, including the policies at the end of the file, never reached the model. Nothing logged that. Anyone reading the file saw the policies sitting right there.
The fix is unexciting: know where the cut-off is, put the critical material first, and raise the limit when you can. The Help Center version strips HTML and extra whitespace before measuring, and caps at 14,000 characters.
A second quiet failure: the prompt template filled placeholders like {business_name}, but the knowledge base didn't go through the same template, so its placeholders reached the model as literal braces.
Clean the output, limit the input
I don't trust the model's formatting. Every reply goes through a cleanup step that removes any stray escalation marker, replaces em dashes, strips emoji and caps the length.
The in-app chat asks the model to end with a line like <suggest>Where is my order? | Refund status</suggest>, which the app turns into reply chips. The server always strips that tag before the reply is stored or shown, including a half-written tag at the end of a reply that got cut off, so no caller can leak it to a customer.
var suggestRe = regexp.MustCompile(`(?s)<suggest>(.*?)(?:</suggest>|$)`)
func takeSuggestions(reply string) (string, []string) {
m := suggestRe.FindStringSubmatch(reply)
if m == nil {
return reply, nil
}
var chips []string
for _, s := range strings.Split(m[1], "|") {
if s = strings.TrimSpace(s); s != "" {
chips = append(chips, s)
}
}
return strings.TrimSpace(suggestRe.ReplaceAllString(reply, "")), chips
}var suggestRe = regexp.MustCompile(`(?s)<suggest>(.*?)(?:</suggest>|$)`)
func takeSuggestions(reply string) (string, []string) {
m := suggestRe.FindStringSubmatch(reply)
if m == nil {
return reply, nil
}
var chips []string
for _, s := range strings.Split(m[1], "|") {
if s = strings.TrimSpace(s); s != "" {
chips = append(chips, s)
}
}
return strings.TrimSpace(suggestRe.ReplaceAllString(reply, "")), chips
}Input is limited too: 500 characters per message, a short history, per-IP limits per minute and per day, a global daily cap, and an off switch. Each limit has a polite reply that points to the articles and the in-app chat.
The articles are published for other AI tools as well: an llms.txt, a full-text version, and every article as Markdown at a stable URL, with the robots file explicitly allowing AI crawlers. If someone asks a general chatbot about Laayo, it can quote the same documents our own assistant uses.
I test changes by replaying real conversations through the service and reading every answer.
Get new posts by email
One email when something new goes up. No tracking pixels, unsubscribe in one click.