Designing Conversations
A good chatbot is planned before it is coded: what it is for, how it speaks and what it does when it does not know.
Step 1: Define the Purpose
Write one sentence: "This bot helps who do what."
Example
This bot helps parents and students of a Karachi computer
institute find course details, timings and admission steps.A clear purpose stops you from building a bot that tries to do everything and does nothing well.
Step 2: List the Top Questions
Look at real messages from WhatsApp, email or the front desk. Usually 10 to 20 questions cover most conversations.
| Intent (what the user wants) | Example messages |
|---|---|
| Timings | "What time are classes?", "timing kya hai" |
| Courses | "Which courses do you offer?" |
| Admission | "How do I join?", "admission kab start hain" |
| Location | "Where are you?", "address bhej dein" |
| Talk to human | "I want to talk to someone" |
An intent is the goal behind a message. Many different sentences can share one intent.
Step 3: Personality and Tone
Decide how the bot sounds, and keep it consistent:
- Name: for example "Zara" or simply "Workownix Assistant"
- Tone: friendly, respectful, short sentences
- Language: reply in the user's language (English, Urdu or Roman Urdu)
- Be honest that it is a bot, not a human
Step 4: Greeting and Quick Replies
A greeting should say what the bot can do. Quick-reply buttons help users who do not know what to ask:
Example
const greeting = {
text: "Assalam o Alaikum! I am the Workownix assistant. I can help with:",
quickReplies: ["Courses", "Timings", "Admission", "Talk to a person"],
};
console.log(greeting.text);
greeting.quickReplies.forEach((q, i) => console.log(`${i + 1}. ${q}`));Assalam o Alaikum! I am the Workownix assistant. I can help with: 1. Courses 2. Timings 3. Admission 4. Talk to a person
Step 5: Plan the Fallback
The fallback is what the bot says when it does not understand or does not know. A bad fallback ("Error") loses customers. A good one offers a way forward:
Example
let failedTries = 0;
function fallback() {
failedTries++;
if (failedTries >= 2) {
return "Let me connect you to our team. You can also call 0300-0000000 (10 am to 6 pm).";
}
return "Sorry, I did not get that. You can ask about courses, timings or admission.";
}
console.log(fallback());
console.log(fallback());Sorry, I did not get that. You can ask about courses, timings or admission. Let me connect you to our team. You can also call 0300-0000000 (10 am to 6 pm).
After two failures, the bot offers a human. This is called a human handover.
Step 6: Write Sample Conversations
Before coding, write a few full conversations as a script:
Example
User: salam, python course ka timing kya hai?
Bot: Walaikum Assalam! Python classes run Monday to Thursday,
5 pm to 7 pm. Would you like the admission steps?
User: yes
Bot: 1) Fill the online form 2) Visit with your CNIC/B-form copy
3) Attend the first class. Anything else?Reading these aloud shows you if the bot sounds natural and helpful.
Good Conversation Rules
- Keep replies short; people read chats on phones.
- Ask one question at a time.
- Confirm important details ("You want the evening batch, right?").
- Never pretend to be human.
- Always give a way to reach a real person.
Review real conversations every week. The questions users actually ask will show you what to add or fix.
Exercise
Exercise
What is a chatbot "fallback"?
