Stella Platform Documentation

Stella Platform Documentation

  • Docs
  • Procedures
  • Reference
  • FAQ
  • Bot API
  • API
  • Languages iconEnglish
    • 中文

›FAQ Chatbot Setup

Get Started

  • Build your First Chatbot

Basic Facebook Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create a Global Node
  • 1.5: Build Child Nodes
  • 2.1: Production Channel
  • 3.1: Draft a Post
  • 3.2: Create Comment Reply

Basic Instagram Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create Global Node
  • 1.5: Build Child Nodes
  • 2.1: Create Story Mention
  • 2.2: Create Comment Reply
  • 2.3: Send Push Message

Basic Web Chat Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create a Global Node
  • 1.5: Build Child Nodes

Basic WhatsApp Chatbot Setup

  • Overview
  • 1.1: WABA Subscription
  • 1.2: Connect WABA
  • 1.3: Check Approval Status of WABA
  • 1.4: Setup WABA with Used WhatsApp Number
  • 1.5: Reset / Terminate WABA
  • 2.1: Create New Tree
  • 2.2: Build the First Node
  • 2.3: Create a Global Node
  • 2.4: Build Child Nodes
  • 2.5: Connect to Datasource
  • 3.1: Create Priority Group
  • 4.1: Create Product Message

Common Use Case Application

  • Overview
  • 1.1: Apply Fail-Safe to Chatbot
  • 1.2: Apply Member Unsubscription Flow to Chatbot

Advanced Chatbot Application

  • Overview
  • Apply Datasource to Chatbot
  • Apply Payload Value to Chatbot
  • Apply API to Chatbot
  • Apply Custom Locale to Chatbot
  • Apply Opt-in Flow to Chatbot
  • Apply Agenda to Chatbot
  • Apply Stella API to Chatbot
  • Apply Web Event to Webchat Chatbot

Error Handling

  • Handle Errors for Chatbot

Stella Partner Portal Setup

  • Overview
  • 1.1: Partner Portal Setup
  • 1.2: New Customer Onboarding
  • 1.3: WABA Setup
  • 1.4: Check Approval Status of WABA
  • 1.5: Setup WABA with Used WhatsApp Number
  • 1.6: Reset / Terminate WABA

Template Tree

  • Overview
  • Create Template Tree
  • Manage Proxy Tree

Chatbot Testing & Deployment

  • Overview
  • Stage One - Tree Building
  • Stage Two - Testing Stage
  • Stage Three - Production Deployment

Slack Live Chat Tree Setup

  • Overview
  • 1.1: Create Tree for Live Chat Assignment
  • 2.1: Set Up Pick Ticket Status
  • 2.2: Create Done Command
  • 2.3: Create Transfer Command
  • 2.4: Create Archive Function
  • 2.5: Create Member Tagging/Remarks Command
  • 3.1: Automatic End Live Chat Function

Zendesk Live Chat Tree Setup

  • Overview
  • 1.1: Create Tree for Assignment
  • 2.1: Create Done Command
  • 2.2: Auto End Live Chat Function

FAQ Chatbot Setup

  • Overview
  • 1.1: Exact Keyword Match
  • 1.2: Keyword Groups Match & Diversion
  • 2.1: Redirect to Existing Chatbot Tree
  • 2.2: Data Analytics for FAQ Chatbot
  • 2.3: NLP for FAQ Chatbot
  • 3.1: Filtering Questions for FAQ Chatbot

NLP Chatbot Setup

  • Overview
  • 1.1: Apply NLP to your Chatbot
  • 2.1: Set Up an NLP Fallback Tree
  • 3.1: NLP Fallback to Other Languages

Connect Shopify Store to Stella

  • Overview
  • 1.1: Integrate Stella to Shopify
  • 2.1: Setup Facebook Messenger Chatbot for Shopify
  • 2.2: Setup WhatsApp Chatbot for Shopify
  • 2.3: WhatsApp Customer Care Notification for Shopify

Stella Inbox Setup

  • Overview
  • 1.1: Connect Channel to Slack
  • 1.2: Access Control & Admin Panel
  • 1.3: Set up Customizable Message
  • 1.4: Inbox Channel
  • 2.1: Turn on Live Chat Directly
  • 2.2: End Live Chat Mode
  • 2.3: Ticketing
  • 2.4: Manage Ticket Helper
  • 2.5: Add Member Tag
  • 3.1: Send Chatbot Message

Exact Keyword Match

What is your Result?

  1. When user types the question (e.g. How much time do you need to build a WhatsApp chatbot?), the FAQ module will scan the entire data source to see if there is an exact match in the keyword group(s).
Example of FAQ Chatbot Data source
  1. Once matched with an FAQ entry, the chatbot will display the answer of the corresponding entry. (In this case, a text response.)
Example of FAQ Chatbot

FAQ Data Source Format

Example of FAQ Chatbot Data source

The basic data source format should in be .CSV file format and includes the following items:

ItemsDescriptionRequired Since
Language"Language" refers to the language of this FAQ entryLevel 1
Category 1-3The categories refer to the option displayed on the Category 1-3 filtering question.Level 5
Category 1-3 PriorityCategory Priority refers to the positional priority (Lower the value, higher the position) of the option displayed on the Category 1-3 filtering questionLevel 5
Question ID“Question ID” is a unique identifier for each entry.Level 1
Question“Question” is for your own reference at this stage. It is a standard sample question you expect the users to ask. For instance, “What is the price for Product A?”

However, if you categorize your FAQs and display them in the form of a list (on Stella Web Chat only), a set of filtering questions (WhatsApp) or in a carousel (Facebook), then the “Question” you have set will be displayed to allow the users to choose from.
Level 2
Analytics CategoryAnalytics Category refers to the unique analytics label for each FAQ entry.Level 4.2
Analytics IDAnalytics ID refers to the analytics category for each FAQ entry.Level 4.2
Keyword GroupThe keyword groups consist of keywords to be searched/matched with user input. You can input multiple variations/synonyms of the keyword. For instance, if you expect users to ask about your product’s pricing, putting “pricing”, “price” or “cost” into the data source will make sense. The format will be [“pricing”,”price”,”cost”]. The words between quotation marks share an “OR” relationship.

You may also set multiple keywords per entry. The relationship between different keyword groups is “AND”. This means that the user's input must match all keyword groups of an entry in order for the chatbot to reply with the corresponding answer. With more keyword groups per entry, you provide more context to the system. (However, this also means that this entry is harder to trigger.)

For example, if the user is asking about "What is the price for Product A?", you may set up keyword group 1 as [“Product A”] & keyword group 2 as [“price”]. You may do the same for Product B, Product C…Product N. Then, each chatbot answer will be replying to a specific product.
Level 1
Intent"Intent" refers to the trained intent of an NLP engine on Google Dialogflow or Microsoft LUISLevel 4.3
Type“Type” is the type of message responses of your answer. For this standard procedure, the type: "Text", "Image", "Video", "GIF", "File", "Audio" & "Redirect" are supported. Please make sure you have the correct type.Level 1
Text“Text” is the chatbot textual answer of the FAQ entry.Level 1
URL“URL” refers to the multimedia link for the “Image”, “Video”, “GIF”, “File” & “Audio”.Level 1
Preview"Preview" refers to the link preview on WhatsApp text response. Set "TRUE" to display the preview.Level 1
Caption"Caption" refers to the caption text of a WhatsApp image. Please make sure "URL" is filled with an image link before inputting the caption.Level 1
treeID"treeID" refers to the tree that Stella should redirect user to. Please make sure "*Redirect" is chosen for message type.Level 4.1
compositeID"compositeID" refers to the compositeID of the tree node that Stella should redirect user to. You may locate this information in here of a tree node. Please make sure "*Redirect" is chosen for message type.Level 4.1

You may download the sample FAQ data source in .CSV here.

Please note that format of quotation marks in the datasource must be " ", otherwise, the keyword group could not display as expected.

Quotation mark format

Getting Hands-on

Sample Tree Structure

Tree Structure of FAQ Chatbot with Exact Keyword Match

Create a New Data Source

  1. Head to “Data Source” and select “+ New Data Source”.
Add a New Data Source
  1. Name your new Data Source.
Name the New Data Source
  1. Import your .CSV file by choosing the file, toggle on “Replace” & “Parse JSON”. You may download the sample FAQ data source in .CSV here.

Remember to toggle on "Parse JSON” in order to avoid possible error.

Import the Data Source File
Toggle to "Append" if you want to add additional entries only; toggle to "replace" if you want to replace the whole data source.
  1. Copy the “Data Source ID” and save it for latter use in “collectionName” in the code later.
Save Data Source ID

Create a Tree Node for FAQ Module

  1. Head to a tree and create a tree node for the FAQ module.

  2. Create a pre-action (this is for handling the exact keyword matching logic) in this tree node with the following code (Remember to apply the Data Source ID to collectionName in the code):

Create Pre-actions
return new Promise((resolve, reject) => {
  console.log("in Save FAQ temp ans")
  let text = this.messageEvent.data.text
  text = text.replace(/\r\n|\r|\n/g, "")
  text = text.replace(/(\/|\.|\*|\?|\+)/g, "")

  function genKeywordsRegex(keywords, text) {
    // return "/(" + keywords.join("|") + ")/i.test('" + text + "')"
    let regex = new RegExp("(" + keywords.join("|") + ")", "i")
    return regex.test(text)
  }

  this.fetchDataFromDataSource({
    collectionName: "enter the Data Source ID here",
    filter: {}
  }).then((result) => {
    console.log("length", result.length);
    const ans = result.filter((doc) => {
      if (this.lodash.isArray(doc["Keyword Group 1"]) && this.lodash.get(doc, "Keyword Group 1.length") && this.lodash.isArray(doc["Keyword Group 2"]) && this.lodash.get(doc, "Keyword Group 2.length") && this.lodash.isArray(doc["Keyword Group 3"]) && this.lodash.get(doc, "Keyword Group 3.length") ) {
        const regex1 = genKeywordsRegex(doc["Keyword Group 1"], text)
        const regex2 = genKeywordsRegex(doc["Keyword Group 2"], text)
        const regex3 = genKeywordsRegex(doc["Keyword Group 3"], text)
        console.log("current doc (3 keyword group)", doc["Question ID"])
        return regex1 && regex2 && regex3
      } else if (this.lodash.isArray(doc["Keyword Group 1"]) && this.lodash.get(doc, "Keyword Group 1.length") && this.lodash.isArray(doc["Keyword Group 2"]) && this.lodash.get(doc, "Keyword Group 2.length")) {
        const regex1 = genKeywordsRegex(doc["Keyword Group 1"], text)
        const regex2 = genKeywordsRegex(doc["Keyword Group 2"], text)
        console.log("current doc (2 keyword group)", doc["Question ID"])
        return regex1 && regex2
      } else if (this.lodash.isArray(doc["Keyword Group 1"]) && this.lodash.get(doc, "Keyword Group 1.length")) {
        const regex1 = genKeywordsRegex(doc["Keyword Group 1"], text)
        console.log("current doc (1 keyword group)", doc["Question ID"])
        return regex1
      } else {
        return false
      }
    })
    console.log("ans", ans)
    this.lodash.set(this.member, "botMeta.tempData.faqAns", [])
    this.lodash.set(this.member, "botMeta.tempData.faqAns", ans)
    // this.member.botMeta.tempData.faqAns = ans
    resolve({ member: this.member })
  })
})

  1. Create a transformed response in “Advanced” in this tree node for displaying the chatbot answer based on the matched entry with the following code:
Transform Response
return new Promise((resolve, reject) => {
  console.log("in FAQ Keyword")
  let ans = this.member.botMeta.tempData.faqAns || []
  console.log("ans", ans)
  if (ans.length >= 1) {
    let response = {}
    switch (ans[0].Type) {
      case "Text":
        response.type = "TEXT"
        response.text = ans[0].Text
        if (ans[0].Preview === true || ans[0].Preview === "TRUE") {
          response.preview_url = true
        }
        break
      case "Image":
      case "Image_Text":
        response.type = "IMAGE"
        response.url = ans[0].URL
        response.text = ans[0].Text
        break
      case "Video":
      case "GIF":
      case "File":
        response.type = "FILE"
        response.url = ans[0].URL
        response.text = ans[0].Text
        response.filename = ans[0]["File Name"]
        break
      case "Audio":
        response.type = "AUDIO"
        response.url = ans[0].URL
        break
      default:
        response = null
        break;
    }
    resolve(response)
  } else {
    resolve({
      type: "TEXT",
      text: "Sorry, we don't have the answer for you at the moment. You  may try to ask us in another way or reach our support team at hello@sanuker.com."
    })
  }
})

Create a Global Node for FAQ Module

  1. Create a global node for triggering the FAQ module in the same tree.

  2. Set the Priority to "10" to make sure the global node can be triggered probably.

Set Priority
  1. Create a trigger in the global node with a pre-defined trigger as “Any Text”.
Create Trigger
Create "Any Text" Trigger
  1. Toggle on redirect to the FAQ tree node you created and save this global node.
Redirect to FAQ Tree Node

Add Tree to Channels

  1. Upon completion of the tree, head to "Channels".

  2. Locate the channel you would like to deploy the tree, click "Edit".

Channels
  1. Head to "Platform", and then "Tree Settings".

  2. Select "+ New Tree", and pick the tree from the dropdown, remember to also select the global nodes. After that, select "Save" to complete adding the tree to channel.

Add Trees
  1. Please remember to add trees to channel by repeating step 11-14 after building FAQ trees of other levels.

  2. Check and see if you can produce the expected outcome.

← Overview1.2: Keyword Groups Match & Diversion →
  • What is your Result?
  • FAQ Data Source Format
  • Getting Hands-on
    • Sample Tree Structure
    • Create a New Data Source
    • Create a Tree Node for FAQ Module
    • Create a Global Node for FAQ Module
    • Add Tree to Channels
Stella Platform Documentation
Docs
Get StartedBot API ReferenceAPI ReferenceStandard Procedures
Community
FAQUser ShowcaseChat with Us
Copyright © 2023 Sanuker Inc. Limited