Vonage AI Studio
  • Welcome to AI Studio!
  • ✨Platform Updates
  • AI Studio
    • Create a new agent
    • NLU AI Engine - Traditional vs Hybrid
    • Agent Building Features
    • Agent Templates
      • Take Message
      • Updating Details
      • Survey
      • FAQ
      • Package Tracking
      • Caller Identification
      • Customer Service
      • Hotels
      • Appointment Management
    • Tester
    • Editor Mode & Publish
    • Reports
    • Users
    • Knowledge AI
  • Properties
    • Entities
      • System Entities List
      • Best Practices
    • Intents
      • How do we analyze user input?
      • Generate Training Data
      • System Intents
      • Intent Annotation
    • Parameters
    • Contacts
    • Tags
    • Recordings
  • Voice
    • Get started
      • Create your first conversational flow!
      • Triggering Outbound Call API
      • Sending an Outbound Call Request via Postman
      • Integration via SIP for Telephony Agents
    • Nodes
      • Start node
      • Conversation
        • Classification
          • Intent Ambiguity
        • Collect Input
          • Entity Ambiguation
        • Speak
        • Conditions
        • Listen
        • Q&A Node
      • Advanced
        • Reset Counter
        • Counter
        • Set Parameter
        • Custom Code
        • NCCO Node
      • Actions
        • Send Email
        • Call Routing
        • End Call
        • Start Recording
        • Stop Recording
        • Send SMS
      • Integrations
        • Webhook
        • Legacy SalesForce Authentication Node
          • SalesForce Authentication
            • How to create a SalesForce Connected App
        • SalesForce Actions
        • Generative AI
          • Setting up Generative AI Node Integration
          • Migrating from the GenAI node to Knowledge AI
      • Flow Control
        • Context Switch
        • Flows
    • Events
  • WhatsApp
    • Get started
      • Create your first conversational flow!
      • Triggering an outbound WhatsApp virtual agent
    • Nodes
      • Start node
      • Conversation
        • Collect Input
          • Entity Ambiguation
        • Classification
          • Intent Ambiguity
        • Send Message
        • Conditions
      • Advanced
        • Reset Counter
        • Counter
        • Set Parameter
        • Custom Code
      • Actions
        • Send Email
        • End Conversation
        • Send SMS
        • Live Agent Routing
      • Integrations
        • Webhook
        • Legacy SalesForce Authentication Node
          • SalesForce Authentication
            • How to create a SalesForce Connected App
        • SalesForce Actions
        • Generative AI
          • Setting up Generative AI Node Integration
          • Endless FAQs on WhatsApp With Generative AI and AI Studio
      • Flow Control
        • Context Switch
        • Flows
    • Events
  • SMS
    • Get started
      • Create your first conversational flow!
      • Triggering an outbound SMS Virtual Agent
    • Nodes
      • Start node
      • Conversation
        • Classification
          • Intent Ambiguity
        • Conditions
        • Send Message
        • Collect Input
          • Entity Ambiguation
      • Advanced
        • Reset Counter
        • Counter
        • Set Parameter
        • Custom Code
      • Actions
        • Send Email
        • End Conversation
        • Send SMS
        • Live Agent Routing
      • Integrations
        • Webhook
        • Legacy SalesForce Authentication Node
          • SalesForce Authentication
            • How to create a SalesForce Connected App
        • SalesForce Actions
        • Generative AI
          • Setting up Generative AI Node Integration
          • Use Case Example: Gym Business
      • Flow Control
        • Context Switch
        • Flows
    • Events
  • HTTP
    • Get started
      • Create your first conversational flow!
    • Nodes
      • Start node
      • Conversation
        • Classification
          • Intent Ambiguity
        • Collect Input
          • Entity Ambiguation
        • Send Message
        • Conditions
      • Advanced
        • Reset Counter
        • Counter
        • Set Parameter
        • Custom Code
      • Action
        • Send Email
        • Send SMS
        • Live Agent Routing
          • Websockets connections for Live agent Routing
      • Integrations
        • Webhook
        • Legacy SalesForce Authentication Node
          • SalesForce Authentication
            • How to create a SalesForce Connected App
        • SalesForce Actions
        • Generative AI
          • Setting up Generative AI Node Integration
          • Use case Example : Online Shopping
      • Flow Control
        • Context Switch
        • Flows
    • Events
  • API Integration
    • Authentication
    • Insights
  • There's more
    • FAQs
    • Languages Available
Powered by GitBook
On this page
  • How to Create an AI Studio WhatsApp Agent
  • How to Use the AI Studio Generative AI Node
  • How to Handle Our Generative AI Response
  • How to Use the Send Email Node in AI Studio
  • Conclusion

Was this helpful?

  1. WhatsApp
  2. Nodes
  3. Integrations
  4. Generative AI

Endless FAQs on WhatsApp With Generative AI and AI Studio

Using Generative AI to Improve Customer Experience

PreviousSetting up Generative AI Node IntegrationNextFlow Control

Last updated 1 year ago

Was this helpful?

In 2023, Generative Artificial Intelligence (AI) and Large Language Models (LLMs) exploded on the scene, with the promise to completely transform the world. According to , in just 2 months reached 100 million users. By comparison, it took TikTok 9 months and Instagram 2 years to achieve the feat.

But what is the significance of this booming technology? I’ve always heard that the best developers are lazy developers. I confess I’m a lazy developer. Generative AI helps us be even lazier! Not only can we ask for refactored code or even wholly coded applications from this predictive AI. But we can outsource the other annoying parts of our applications, like all the data values we want to give our users.

Using Generative AI with another tool for lazy efficient developers, Vonage’s low code platform called AI Studio, you can now improve your customer experience exponentially. In this article, you will learn how to replace your company’s Frequently Asked Questions (FAQ) site and turn it into a flexible, comprehensive FAQ WhatsApp agent (also known as a chatbot).

TLDR; If you don’t want to build out the Agent, you can and import it to AI Studio following . You’ll still need to do the

Mission: Turning Static FAQs into an Interactive WhatsApp Agent

You will notice that we must create an intent not just for each action phrase that we will listen for but also for each FAQ question and answer pairing. But we are lazy builders and this would take so long!

Thank goodness with the Generative AI node we can simplify our agent drastically. Now our mockup looks like this:

Notice that now our Generative AI node will not only eliminate the need to define individual question/answer pairings but also handle intent classification! So in our final WhatsApp Agent, which will answer FAQ questions about AI Studio, we simply need to collect the user inquiry and send it to the Generative AI node which will either send back a Gen AI answer or route the inquiry to our email support action.

Prerequisites

  • You will need a Vonage Developer Account

Configuring Your Generative AI Account in AI Studio

How to Create an AI Studio WhatsApp Agent

  • Type: WhatsApp

  • Template: Start From Scratch

  • Event: Inbound

How to Use the Collect User Input Node

Now that we have the user’s inquiry, we’re all set to start using our Generative AI node!

How to Use the AI Studio Generative AI Node

First, let’s select the Generative AI node from the Integrations section like so:

Add Picture

The configuration for our node will be:

  • OpenAI integration: Select your OpenAI Key (see Prerequisites)

  • User Input Parameter: INQUIRY

  • Organization Name: Vonage AI Studio

    • This helps the LLM better understand who it’s talking about so it doesn’t get confused with similarly named organizations.

  • Knowledge Base Description (KBD):

    • Here we will add all of the information from the FAQ site on the AI Studio site with a little bit of “massaging”.

Massaging Your KBD

On an FAQ site you might see something like:

I have a cool feature idea - how can I let you know about it? You can let us know about your feature idea directly on the AI Studio by clicking on the question mark button on the top right.

When added to the KBD, it should be able to stand alone and be declarative:

If you want to let us know about a feature idea, you can submit feedback directly on the AI Studio by clicking on the question mark button on the top right.

Additionally, to help the LLM better answer questions, we’ve pulled a bit of general information from our homepage:

Vonage AI Studio is a conversational AI platform built to handle complex interactions between businesses and customers, lowering operational costs and significantly improving service levels

KBD Character Limits

Note that the Knowledge Base Description has a limit of 6000 characters. If that is not enough you can create more focused flows with more specific intents and more specific Knowledge Base Descriptions.

  • Output Parameter: GEN_AI_ANSWER

    • Create a new parameter to hold the response we receive from the LLM

For now, we will skip the Actions tab and leave it blank. Open the Configurations tab and set it to look like this

  • Creativity Level: None

    • The temperature reflects how much the model will go outside of the KBD and pull information from the internet for its answers. Experiment with this knob until you find a comfortable setting.

  • Timeout: 10 seconds

    • The timeout refers to the amount of time that the agent will wait to receive an answer from the LLM. Longer answers may take a longer response time but also your user may get impatient and begin typing messages to the agent which may cause it to error.

  • Output Parameter: GEN_AI_ANSWER

    • Create a new parameter to hold the response we receive from the LLM

When you’ve filled it all out, your node should look like this:

Click “Save & Exit” and our agent is ready to send questions and receive answers from OpenAI.

How to Handle Our Generative AI Response

Now that we’ve hooked up our node to get FAQ answers, let’s send them to our users! The whole flow will look like this:

This may look kind of complicated but most of it is error handling and improving the user experience. The Generative AI node creates 4 exit points: INQUIRY (success), Fallback, Conversation Ended, and Failed. These exit points provide us with some error handling depending on the result we get back from Open AI. And the rest of the nodes allow our users to keep asking questions until they are satisfied.

To build it out:

  1. For INQUIRY exit point:

    Use a Send Message node and have it simply send $GEN_AI_ANSWER. Connect our Inquiry exit point to this node.

  2. For Fallback exit point:

    Use a Send Message node and have it send an error message. Something like "Uh oh, we weren't able to find an answer to that. Let's try again.” Connect our Fallback exit point to this node. And from this node connect back to the Collect Inquiry node we made before. This will allow the user to ask again.

    • A Fallback exit point occurs when the Generative AI is unable to answer the question

  3. For Conversation Ended exit point:

    Use an End Conversation node and connect our Conversation Ended exit point to this node.

    • A Conversation Ended occurs when Gen AI node recognizes that either the end-user or GPT has ended the conversation

  4. For Failed exit point:

    Use a Send Message node and have it send an error message. Something like "Oops! There was a problem. Let's try again.” Connect our Failed exit point to this node. And from this node connect back to the Collect Inquiry node we made before. This will allow the user to ask again.

    • A Failed exit point refers to an API error or timeout

  5. So that our users know the flow is over and our agent is “asleep”, let’s create one final Send Message node with a simple Goodbye Message, “Thanks for using AI Studio!” Connect our false condition to this node.

How to Use the Send Email Node in AI Studio

Let’s implement the Email Support flow now. Remember when we skipped the actions tab in the Gen AI node? We can go back and set that up now. All we need to do is add our action phrase! So it should look like this:

Without having to define any user intents, our Generative AI node uses this action phrase along with the knowledge base to understand our users. Amazing!

  • Collect User Email

    • Using a Collect Input node ask the user for their email address

      • E.g. “Great! Can I have your email address?”

    • Store it inside a new Parameter USER_EMAIL

    • Set this parameter to @sys.email so that AI Studio will only accept valid email addresses

  • Collect User Question

    • Using a Collect Input node ask the user for the question that was unanswerable by the agent

      • E.g. “Great! Please explain the question you have and I'll pass it along to support 💌”

    • Store it inside a new Parameter EMAIL_INQUIRY

Now we are ready for the Send Email node. The configuration for our node will be:

  • To: support[at]api.vonage.com

    • Make sure to hit enter so that the address is saved, it should turn into a grey block

    • You can add more than one email recipient

  • Subject: New FAQ Agent Question: $PROFILE_NAME

  • Body:

Contact Info:

  • Respondent Name: $PROFILE_NAME

  • Respondent Phone Number: $SENDER_PHONE_NUMBER

  • Respondent Email: $USER_EMAIL

User Submitted Question:

$EMAIL_INQUIRY

Conversation Time:

$CONVERSATION_START_TIME

Your node should look like this:

Now we can connect our Email Support node to the Collect Repeat node. This allows our user to ask more questions or end the conversation.

And that’s it! Our agent is fully built!

Conclusion

Does your classification node work? Is your agent able to differentiate when you want to send an email or ask a question about AI Studio? Try asking questions directly from the FAQ site and seeing how the answers compare. Then maybe try asking your agent questions that deviate a bit from the FAQ. And then questions that are entirely not apart of the training data!

Our mission in this article will be to turn an FAQ site into a WhatsApp Agent. We will use site and turn it into an agent.

You will notice that this site not only contains the traditional FAQ question-and-answer format but also tells users that for any unanswered questions, they can email support@api.vonage.com. This is important in a Generative AI agent as the user’s intent (more about ) is not to receive an answer here but rather to trigger some action. We call these action phrases. Action phrases can be things like emailing support, connecting users with a human agent, filling an order, and more! With AI Studio’s you are really empowered to build advanced integrations.

I always suggest of the agent we want to build. This is how our agent would look if we wanted to build without the new Generative AI node:

In order to use the Generative AI node, you will need to set up a paid account directly with OpenAI. and create an account.

To be able to follow this tutorial you will need to make sure to have your AI Studio account up to date with the latest Generative AI integration instructions. Follow .

To begin we’ll need to create a WhatsApp agent. You can open AI Studio from inside the Vonage and then follow the instructions found in the . There are three important options for our agent, to select:

Let's greet our users with a welcome message. Let’s use the node. I like to attach a photo to our welcome message to use our company branding.

Next, we'll accept our user's response with a node. We’ll store the response in a called INQUIRY. The expected input should be only text.

Unless otherwise specified, all parameters in this blog post will use the @sys.any entity. For more information about entities (different types of parameters) in AI Studio, please .

We want to allow the user to ask multiple questions of our chatbot. So now create a Collect Input node called Collect Repeat that will save a new Parameter called REPEAT. The node will receive inputs. One button should have a title Yes and value of true. The other button should have a title of No and a value of false.

Now we’ll use a which will check against REPEAT. Create one condition to check if REPEAT is equal to true, and another to check if REPEAT is equal to false. Connect the true condition again to the Collect Inquiry node, the first collect input node we used.

Connect the false condition to an node.

You can now your agent and ask it questions!

Next, we’re going to need 2 additional pieces of information from the user before we can use the node:

$PROFILE_NAME is a that allows us to access the user’s profile name they set in WhatsApp. Note: not everyone uses their real name as a profile name.

👏Give yourself a round of applause! You did it! You built your first Generative AI WhatsApp agent. Now let’s test using the built-in .

How does your agent behave? Let me know! Join the and tell me what your building in the #ai-studio channel. Or find on X, formerly known as Twitter. And give a follow while you’re at it.

AI Studio’s own FAQ
AI Studio Intents
webhook node
starting with a mockup
Sign up with OpenAI using this link
these instructions
Developer Dashboard
AI Studio documentation
Send Message
Collect Input
parameter
read the documentation
Reply Button
Condition Node
End Conversation
test
Send Email
System Parameter
tester
Vonage Developer Community Slack
me
VonageDev
SimilarWeb
ChatGPT
copy the ZIP file
these instructions
Generative AI setup