Making AI Chatbots:
Best Practices (Advanced)¶
Here are more design tips if you want to use the Juji Platform to optimize your AI chatbot performance and deliver superior user experience.
Use Proper Chatbot Request¶
If your goal of a request is to guide users to different directions or gathers user input to a limited set of options, use the choice request. It is deterministic, quick, and almost error free.
If your goal is to elicit open-ended user input, e.g., their insights or unanticipated responses on a particular topic, use a free-text request. Because a free-text request is intended to gather open-ended user input, be aware of potential highly diverse user digressions. To handle such user digressions, make sure that you choose a right Juji built-in dialog to handle such situations automatically. You can of course write custom chatbot actions to handle specific user input that you wish to capture and address.
Use Proper Chatbot Trigger¶
Depending on your chatbot application, the tip below helps you
decide whether you use a
is-similar-to trigger when you customize your chatbot actions.
contains-keywords will help better match a user input
syntactically as long as the input contains the keywords. In contrast,
is-similar-to will help better match a user input semantically
regardless of its syntactic form.
Assume that your chatbot asks
What's your favorite fruit?. You
define a trigger
contains-keywords to capture particular kind of
As long as a user input contains a keyword that matches with the fruit
name you put into, the trigger will fire. For example, it will match a
I really like strawberries:
It will also match a user input with very different meaning
fruit except strawberries:
This is because both expressions contain the keyword 'strawberry` regardless their use with different semantics. Note that Juji automatically handles [stemming and lemmatization] (https://nlp.stanford.edu/IR-book/html/htmledition/stemming-and-lemmatization-1.html) in keyword matching to support the matching of word variations.
contains-keyword trigger would not match
blueberry because these are very different keywords:
In contrast, if you define a trigger
is-similar-to with examples
I like strawberries:
This trigger will match a user input
I like blueberries because this
expression is considered semantically similar:
With a high enough matching threshold (e.g.,
90%), the trigger will not match
semantically different input such as
I dislike strawberries
even though it contains the word `strawberries'.
In short, a rule of thumb is that if you care about capturing the
semantics of a user input more accurately, use
you can give words, phrases, and full sentences as examples. If you
care about capturing a particular word/phrase regardless how it appear
syntactically in an input, use
In the near future, we will support the use of both in one trigger.
Give Sensible Labels¶
The label of a free-text request is a very important piece of information. It is used for multiple purposes. As described below, it is used to
summarize a chat topic (i.e., displayed on the topic card in the left panel)
search for built-in Juji dialog
translate user inquiries in context
index user answers in an audience report.
Search for Built-in Juji Dialog¶
A request label is always used to find a matched Juji built-in dialog
to handle conversations around the request. For example, Juji has a
built-in dialog that handles diverse user responses to the request
What are your hobbies. To find such a built-in dialog, Juji uses the
label entered with the request. Giving a sensible lable can
better help Juji find the right built-in conversation, which can then
handle diverse user responses on that topic with no or little
In particular, we suggest that you give short, concise labels to distill chatbot requests, which facilitates the finding of matched built-in dialogs. For example, if your chatbot is intended to ask a user about his/her opinion about an event, it might give a long description of the event before posing the question. In such a case, put the long and full description in the request, but keep the request label short and concise as shown in the example below:
Here is another example showing that the request wording is long while the label is kept short and to the point:
In case you don't think the label you entered retrieves a suitable built-in dialog, you can always browse Juji dialog library to search for a more suitable built-in dialog.
Handle Context-Sensitive User Inquiries¶
In a conversation, a user may pose a context-sensitive inquiry. For
example, a chatbot asks
Everyone loves movies. What's your favorite
movie?. A user may ask a reciprocal question instead of answering the
What's yours. In such a case, the chatbot must first translate
this user inquiry
What's yours into a full inquiry
favorite movie based on the context before processing the user inquiry.
Currently Juji automatically translates a context-sensitive user inquiry based on the label instead of the request itself. This is because the label often captures the core question. A translation based on the core question can avoid unnecessary noises. Below shows two example requests and their labels, which are used for handling context-sensitive user inquiries.
In this example, the label captures the core of the request but not additional description.
Based on this label, below shows a chat fragment that handles a context-sensitive user inquiry on this topic:
Here is another example showing the label is just the stem of the question:
A conversation fragment shows that how the chatbot handles a context-sensitive inquiry on this topic:
Index User Responses in Audience Report¶
Another use of a request label is to index the user answers to the request in the audience report. Below is an example of audience report. It shows various user answers to the above two requests. As shown, both labels mentioned above are used to index the corresponding user answers.
Since the labels are often more concise than the original requests, using them to index user answers makes the report more consumable.
See these instructions to download an audience report.
Clone Chatbot for Different Audiences¶
In some cases, you may want your chatbot to behave slightly differently for different audiences. For example, one chatbot needs to redirect to a different URL after it is done chatting, while the other chatbot may generate a unique code at the end of the chat. To reuse most of the shared chatbot content, you can easily clone a chatbot as shown below and then deploy different chatbots for different audiences.
Make "Native" Juji AI Chatbot¶
While Juji Studio provides an easy way to author, test, deploy, and manage an AI chatbot, Juji API provides the flexibility of integrating an authored chatbot into any third-party applications, such as a web or a mobile application. We strongly encourage the use of both. For example, content creators such as social media marketers or sales personnel can use Juji Studio to enter the content of a chatbot. On the other side, the IT or engineering team can use the Juji API to integrate such a chatbot into business applications to deploy a chatbot "native" to the applications. This separation of duties gives each team the freedom to operate while allowing them to collaborate on the same chatbot.