← Case Studies SIEF ALSHEYAB / CASE STUDY Resume ↗
AI Automation · LLM · Bilingual

AI Sales Bot — Bilingual Lead Automation

Bilingual Arabic/English AI sales and support bot built for an AI training company. Handles inbound lead qualification, course routing, FAQ responses, and automated follow-up — integrated directly into the production CRM pipeline via webhooks and internal API.

Bot Architecture LLM Integration Intent Classification Arabic/English NLP CRM Routing Webhook Integration Lead Automation Production Deployment

Problem

An AI training company in Amman, Jordan was handling inbound sales inquiries manually — sales staff responding to leads one by one via messaging channels in both Arabic and English. High lead volume, inconsistent response times, and repetitive qualification questions were creating friction in the sales pipeline and slowing course enrollment.

The company needed an automated first-response layer that could handle inquiries at any hour, qualify leads in both languages, recommend the right course, and push structured lead data into the CRM — without requiring manual intervention for common cases.

Solution

Built a bilingual AI bot that acts as the first touchpoint for inbound leads. The bot handles the full qualification loop: greet the lead, understand their intent, ask targeted questions, recommend a course based on their profile, answer common questions, and push a structured lead record into the CRM for sales team follow-up.

The bot is language-aware: it detects whether the user is writing in Arabic or English and responds in kind throughout the conversation. For mixed-language inputs — common in Arabic-speaking markets — it defaults to the lead's dominant language. Low-confidence or escalation-flagged conversations are handed off to the human sales team with full context.

Conversation Flow

01
Language Detection
On first message, the bot detects language from script and vocabulary signals. Arabic (RTL) and English (LTR) are handled natively; mixed inputs are classified by dominant language token frequency.
02
Intent Classification
Each message is classified against a set of intent categories: course enquiry, pricing question, schedule / availability, registration intent, general FAQ, and unclassified / out-of-scope. The LLM returns a structured intent label and confidence score per turn.
03
Lead Qualification
For course enquiry and registration intents, the bot runs a qualification sequence: background level, learning goal, schedule preference, and contact info. Responses are stored per session and compiled into a structured lead record.
04
Course Recommendation
Based on the qualification answers, the bot recommends the best-fit course from the available catalogue. Recommendation logic uses a rule-based routing layer backed by the LLM for natural-language explanation generation.
05
CRM Push
On qualification completion or registration intent signal, the bot pushes a structured lead payload to the CRM via internal API: name, language, course interest, qualification answers, conversation summary, and timestamp. The sales team sees a complete pre-qualified lead — not a raw chat transcript.
06
Escalation & Handoff
On low intent confidence, explicit human-request, or complaint signals, the bot flags the conversation for human follow-up with a summary note and pauses automated responses. The sales team picks up with full context.

Bilingual Implementation

Arabic
Full Modern Standard Arabic and Levantine dialect support. RTL-aware response formatting. LLM prompt instructions enforce Arabic output register and tone. Common transliterated terms (Arabizi) are handled via pre-processing normalization before intent classification.
English
Standard English with formal sales and support register. Consistent tone across FAQ and qualification paths. Prompts specify word-economy constraints for messaging channel display constraints.

Language switching mid-conversation is handled gracefully: if the user switches languages, the bot follows on the next response. This reflects common communication patterns in the target market where users code-switch between Arabic and English.

Architecture

Message IntakeInbound messages arrive via webhook from the messaging platform. The intake layer validates the payload, extracts sender identity and message content, and initiates or retrieves the session state for that lead.
Session StateEach lead conversation is tracked as a session: language preference, conversation stage, qualification answers collected so far, intent history, and escalation flags. State is persisted across messages so multi-turn conversations maintain context.
LLM Inference LayerLLM API call with a structured system prompt that encodes: language mode, current conversation stage, bot persona, and response constraints. Returns both the user-facing message and a structured metadata object (intent, confidence, stage transition signal) per turn.
Routing EnginePost-LLM routing logic: checks intent classification output, determines next stage, extracts qualification fields from the response, and decides whether to continue, push to CRM, or flag for human handoff.
CRM IntegrationOn qualification completion, the bot assembles a structured lead payload and calls the CRM internal API endpoint to create a new lead record. The CRM pipeline picks up from there: assignment, follow-up scheduling, and enrollment tracking.
Follow-up AutomationFor leads that expressed interest but did not complete qualification, scheduled follow-up messages are queued via node-cron. Timing and message content vary by conversation stage reached and time elapsed since last interaction.

Tech Stack

Node.jsExpress.jsLLM API Intent ClassificationWebhook IntegrationSession State CRM REST APInode-cronnodemailer Arabic NLPStructured PromptingDocker

Key Features

Security & Privacy

Lead conversation data is processed in-transit and stored as structured session state only. No raw conversation transcripts are retained beyond the active session. CRM lead records contain only structured qualification fields — not free-text chat logs.

LLM API calls use server-side key management with no client-side credential exposure. Webhook payloads are validated using HMAC signature verification before processing. No user PII, conversation samples, or lead data is disclosed in this case study.

Source Code & Constraints

Source code is private. The bot is in active production use. This case study describes architecture, conversation flow design, and technology choices. No client data, conversation samples, prompt templates, API credentials, or proprietary routing logic is disclosed.

What I Would Improve Next