B4 · Domains of AI: Vision, Language, Speech and Robotics

Designing a Chatbot Conversation

Designing a chatbot conversation means planning it before building it: deciding the purpose, listing what users will ask (the intents), writing the replies, planning what happens when the bot does not understand (the fallback), and drawing the whole conversation as a flowchart.

10 min Beginner Jump to the activity

What you need: Nothing. This page starts from the beginning, with no programming and no formulas.

Definition

If you had to write down everything a library helper says in a day, where would you start?

Designing a chatbot conversation means planning it before building it: deciding the purpose, listing what users will ask (the intents), writing the replies, planning what happens when the bot does not understand (the fallback), and drawing the whole conversation as a flowchart.

In simple words

It is like writing the script for a helpful shop assistant. What will customers ask? What should the assistant say? What if the customer mumbles? And when should the assistant call the manager? A chatbot is only as good as this script.

Why it matters

Most frustrating chatbots fail because of poor design, not poor technology. Planning a conversation teaches you to think from the user's side, to expect mistakes, and to give people a way out. These are skills for any product, not only chatbots.

Key terms

Conversation design
Planning what a chatbot says and how a dialogue should flow.
Persona
The character a chatbot presents: its name, tone and style of speaking.
Utterance
One thing a user might say or type.
Fallback
The reply used when the chatbot does not understand.
Escalation
Passing the user to a human when the chatbot cannot help.
Confirmation
Checking with the user before carrying out an important action.

Explained in detail

Start with research, not with replies

The commonest mistake in building a chatbot is to guess what users will ask. Good designers find out. They read past emails and call records, sit with the people who answer questions at the counter, and ask real users. A useful technique is called Wizard of Oz testing, after the story in which a great wizard turns out to be an ordinary man behind a curtain. Before anything is built, a person secretly plays the part of the chatbot and types the replies. The designers learn what people really ask and how they phrase it, at almost no cost.

Give the bot a clear character

Every chatbot has a persona whether its designers plan one or not. Deciding it in advance keeps the replies consistent. Is the bot formal or friendly? Does it use "aap"? How long are its sentences? Does it use emoji? A bot for a hospital should sound calm and respectful. A bot for a children's library can be warmer. Whatever the tone, an honest persona never claims to be human and does not pretend to have feelings.

Writing for a chat window

Weak replyBetter replyWhy
"How may I assist you today?""I can track an order, start a return or explain a charge. Which would you like?"Tells the user what is possible
"Please provide your order number, your registered mobile number and the date of purchase.""What is your order number?"One question at a time
"Invalid input.""I didn't understand that. You can type 'track', 'return' or 'agent'."Shows the way forward
"Your order is cancelled.""You want to cancel order 4471, the blue kurta. Shall I go ahead?"Confirms before acting

Plan for failure in three steps

  1. First miss: ask the user to rephrase, and give examples of what they can say.
  2. Second miss: offer a short menu of the most common options.
  3. Third miss: hand over to a person, passing along the conversation so far so that the user does not have to repeat it.

Design for everyone

  • Offer a choice of language in the first message.
  • Use short, common words. Many users are reading in their second or third language.
  • Provide buttons for common choices, which help people who find typing slow.
  • Make sure it works with a screen reader and, where possible, by voice.
  • Do not ask for personal information the task does not need.

Measure, read the logs, improve

A chatbot is never finished at launch. Designers watch a few numbers: how many conversations end with the task completed, how often the fallback is triggered, how many users ask for a person, and how users rate the experience. Most of all they read the conversations in which the bot failed. Each one shows a question nobody planned for or a reply that confused someone, and each becomes an improvement in the next version.

How it works

  1. Purpose: write one sentence. "This bot helps students find books and check library hours."
  2. Users: who will use it, and how do they speak? Young students write differently from teachers.
  3. Intents: list the five to ten things users will ask most.
  4. Example messages: for each intent, write several ways of asking.
  5. Replies: write a short, clear reply for each intent.
  6. Fallback: decide what the bot says when it does not understand, and when it hands over to a person.
  7. Flowchart: draw the conversation with boxes and arrows.
  8. Test: ask friends to try it, note where they get stuck, and improve.

Example: a library helper

IntentWays a user might askReply
GreetingHi / Hello / NamasteHello! I can help you find a book or tell you the library hours. What would you like?
Opening hoursWhen are you open? / Timings? / Kab khulta hai?We are open from 9 a.m. to 5 p.m., Monday to Saturday.
Find a bookDo you have Panchatantra? / I need a science bookAsk: "Which title or subject?" Then give the shelf number.
Return dateWhen do I return my book?Books are due 14 days after you borrow them.
FallbackAnything elseSorry, I didn't catch that. I can help with books, hours and return dates. Or type 'staff' to reach the librarian.

Rules of a good conversation

  • Say at the start that it is a bot and what it can do.
  • Keep replies short. One idea in each message.
  • Ask one question at a time.
  • Never trap the user. After two failed tries, offer a person or a menu.
  • Do not ask for information you do not need.

Try it yourself

A conversation follows the flowchart

A student messages the library helper bot.

Build a paper chatbot

You need paper, a pencil and a partner.

  1. Choose a purpose, such as a tuck-shop helper or a helper for the school sports day.
  2. Write five intents on five cards. On the back of each card write the bot's reply.
  3. Write one fallback card for anything else.
  4. Draw a flowchart: greeting at the top, an arrow to each intent, and an arrow to the fallback.
  5. Play: your partner is the user and asks anything. You are the bot and may only read from the cards.
  6. Count how often you needed the fallback card. Add intents for the questions you missed.

Think about it

  • Which questions surprised you? Could you have predicted them?
  • How did your partner feel when the bot could not answer?

Common mistakes

  • Starting with the technology and not the purpose.
  • Forgetting the fallback, so users get stuck in a loop.
  • Writing only one way of asking for each intent. Real users phrase things in many ways.

Check yourself

Question 1

1. What is an intent?

Question 2

2. What is a fallback?

Question 3

3. Which is good chatbot design?

Summary

  • Plan before building: purpose, users, intents, replies, fallback, flowchart, testing.
  • Write several ways of asking for each intent.
  • A clear fallback and a route to a person matter more than clever replies.

Finished reading?

Sources: AI4K12: Five Big Ideas in AI · UNESCO: AI competency framework for students