All posts
AI
May 27, 20268 min read

Building an Arabic AI chatbot that actually understands dialects

MSA is not enough. Here is how we route Khaleeji, Egyptian, and Levantine messages to the right prompt without forcing customers to code-switch.

Y
Yousef El-Masry
AI Engineer

Why generic models fumble

Off-the-shelf LLMs handle Modern Standard Arabic well because that is what most training data looks like. Real customers, however, write in dialect — 'وش تسوّي فيها' from Riyadh reads nothing like 'إيه اللي بتعمله فيها' from Cairo. A single MSA prompt produces stiff, robotic replies.

Detect first, then answer

We run a lightweight dialect classifier on the first turn — Khaleeji, Egyptian, Levantine, Maghrebi, or MSA. The classification switches which system prompt the reply model sees, and lexical hints (e.g. common Khaleeji greetings) bias completions toward the same register.

Grounded in store data

Dialect handling is only half the win. The other half is refusing to hallucinate order numbers or return windows. Every product-aware answer is generated only after a tool call to Salla, Zid, or Shopify — so the chatbot can say 'طلبك #4821 خرج من المستودع أمس' with confidence, not guesswork.

Try Muhadith with your store

One unified inbox and Arabic-native AI — set up in under an hour.

Get started free

Keep reading