If you’re interested in leveraging Generative AI within a Voice bot, you can quickly get started with this bot template.

The template provides a way to use a Voice bot with a knowledge base that supports enriched answers created via Generative AI.

The template shows how to leverage voice interactions, use SSML, and integrate with a knowledge base. There are global functions used to showcase functionality; you can leverage and change these for the specific bot being built.

The template assumes a “Health” use case, but you can modify this too.

Here's a partial view of the Welcome dialog in the template:

The default Welcome dialog in the bot template

Included items


  • Welcome: The Welcome dialog greets the user, introduces the bot functionality, and directs the consumer. This has the complete success flow including the transfer to an agent. The dialog can be broken in multiple dialogs as needed.
  • Repeat the question: In error cases, this dialog asks the consumer to repeat the question.


  • KBIntegration: Integrates with a knowledge base that leverages Generative AI to enrich answers.

Configuration needed

Contact LivePerson to turn on the Fallback prompt

By default, the Welcome dialog uses a design paradigm we recommend for Voicebots. It flows like this:

  1. The consumer asks a question.
  2. The knowledge base is searched for the answer.
  3. If the answer is found, it's played.
  4. If the consumer says anything else after that, the knowledge base is searched again.

We recognize that the consumer might follow up with something like, "Thank you. I'm all set," instead of another question. This kind of non-intentful chitchat won't yield an article match from the knowledge base. And when there's no article match, ordinarily no call to the LLM service is made for an enriched answer. However, you can specify a No Article Match prompt to support non-intentful chitchat.

When you specify a No Article Match prompt, a call to the LLM service is still made even when there's no article match, and the dialog flow in this template works as intended.

Be aware that a No Article Match prompt can yield answers that are out-of-bounds. The model might hallucinate and provide a non-factual response in its effort to generate an answer using only the memory of the data it was trained on. So use caution when using one, and always test thoroughly.

General dialog customization

  • Review each of the dialogs and interactions, starting with Welcome, and customize the verbiage used to greet your customer and request their details.
  • Modify the voicename or other aspects by changing the SSML.
  • If you don’t want to use SSML, remove the SSML tags, and simply adjust the text.
  • If you use the SSML with custom variables like voice name or detecting customer name, use the JavaScript as in the “Welcome Question” Interaction.

A section of the JavaScript in the interaction

In some cases, based on your provider, the customername might not be populated. Make changes to the bot as per this need.

The bot variables can be customized in Global Functions.

KBIntegration interaction customization

If you change the name of the KnowledgeAI™ integration, customize the KBIntegration interaction accordingly. Do likewise for the post-process code that’s also in the interaction.

Within the Integration interaction, make sure that the Enriched answers via Generative AI setting is turned on (#1 below) and the correct Enrichment prompt is selected for the Voice bot (#2 below). You can also optionally select a No Article Match prompt (#3 below).

The default states of the Integration interaction that invokes a KnowledgeAI integration to perform an article search

Learn about selecting a prompt from the Prompt Library.

Global Functions customization

Select Global Functions from the menu to access all the global functions and variables to be configured. Modify the functions to keep only what you require.

A section of the global functions in the bot

Pay attention to the "escape" function and do not delete this from the Global Functions.

The definition of the escape function

Transfer to Priority Queue interaction

Modify the phone number appropriately so that the transfer of the call to an agent can be done.

The default configuration of the Transfer Call interaction

If you have a transfer to a SIP URI, select “Make SIP call over SIP trunk” from the Transfer type dropdown, and include the SIP URI of the destination.

Transfer to Messaging

Alternatively, if you do not have a case to transfer the voice call to an agent, enable these interactions that support transfer to a Messaging channel:

  • Transfer to Messaging
  • Play on Token Failure
  • Play on Eligibility Failure
  • Play on Invite Failure
  • Message Sent

In the Transfer to Messaging interaction, include appropriate post body JSON, for example (change the data; don't use as is):

  "consumerPhoneNumber": "{$botContext.custphone}",
  "handoffId": "H667444301565799",
  "skill": "airlinemessageskill",
  "ivrNumber": "+18333812393",
  "sdes": [{
    "type": "personal",
    "info": {
      "firstname": "{$botContext.custname}",
      "lastname": "",
      "contacts": [{
        "phone": "{$botContext.custphone}",
        "address": {
          "country": "United States",
          "region": "NA"
      "gender": "MALE",
      "language": "en-US",
      "company": "LP"
    "type": "ctmrinfo",
    "info": {
      "cstatus": "VIP",
      "loginStatus": 1

In the Play on Token Failure interaction, provide an appropriate message and have an intent to “Continue with Voice” and “Close Conversation."

In the Play on Eligibility Failure interaction, provide an appropriate message and have an intent to “Continue with Voice” and “Close Conversation.”

In the Play on Invite Failure interaction, provide an appropriate message and have an intent to “Continue with Voice” and “Close Conversation.”

In the Message Sent interaction, provide an appropriate message.

You can also choose to disable “Transfer to Priority Queue.”

Review the documentation on the Transfer to Messaging interaction to learn more.


This is the integration that is used to connect to the knowledge base. Modify this to select the appropriate knowledge base.

The default configuration of the knowledgeai integration

Learn more