How to build an AI Assistant (Interactive AI) with GCP & Dialogflow

AI Assistant
We describe how to make an AI assistant (interactive AI) with GCP and Dialogflow.
We can create more advanced AI by evolving the backend system based on this AI.
NagareLab Assistant also uses this technology.
 
Sponsored Links
You have been blocked from seeing ads.

Dialogflow Setup

  •  Access Dialogflow site on GCP.
  • Click “Go to console”.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Click “Sign-in with Google”.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • The Google account login popup appears. Select Google account to sign-in.
  • Dialogflow requests access to a Google account, so allow it.
  • Request account settings when accessing Dialogflow console for the first time.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Set the country or region, check “Terms of Service” and click “ACCEPT”.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Dialogflow console is displayed.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • This completes the initial preparations for starting the use of Dialogflow.

Interactive AI development with Dialogflow

  • Click “CREATE AGENT” on the Dialogflow console.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • The agent creation screen is displayed.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Enter “Agent name”, select “DEFAULT LANGUAGE”, “DEFAULT TIME ZONE”, “GCP PROJECT to which the agent belongs” and click “CREATE” on the upper right of the console.
    • You can only create one Dialogflow agent per GCP project. Therefore, if you want to create multiple interactive AIs, you also need multiple “GCP projects to which the agent belongs”.Dialogflow QuickStart
      Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Agent is created in default state.
    • Free “Standard” status. It is described in the lower left of the screen.
    • Dialogflow offers various functions even with the free standard plan. However, it can be upgraded if necessary.
  • Multiple “Intents” can be registered in the “Intents” menu. “Intent” can define the processing that AI performs according to the message received from the user.
  • First, click “Default Welcome Intent”.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • “Default Welcome Intent” is the default “Intent”.
    • This is the definition of what AI is to answer when a user greeting such as “Hello”.
  • You can set the example sentences that the user asks to AI with “Training phrases”.
    • The default screen of “Default Welcome Intent” is described below. You can edit if needed.
    • This is not used as a condition judgment by exact match. This is used as learning data for natural language processing by machine learning. Therefore, the question for similar expressions meet the conditions.
  • You can define the text that AI answers with “Text Response”.
    • The following is an example edited from the default. If multiple registrations are made, the response will be performed randomly.
  • After changing the settings, click “SAVE” at the top of the screen.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • You can check the current AI movement on the right side of the console screen. If you type “Hello”, you can see the answer of AI.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Then click “Default Fallback Intent” in “Intents”.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • “Default Fallback Intent” is the default “Intent”.
    • This defines the content that the AI answers when the user asks a question that is not registered in another “Intent” (a question that AI cannot understand).
  • You can define the text that the AI answers in “Text Response”.
  • Then click “SAVE” at the top of the screen.
  • If you ask a question in the right part of the screen that you have not registered in another “Intent”, AI will respond with the defined content.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Click “CREATE INTENT” at the top of the screen in the “Intents” menu to create a new “INTENT”.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Enter “Intent” name, enter user’s question in “Training phrases”, enter AI answer in “Responses”.
  • Click “SAVE” at the top of the screen.
  • If you enter the question defined in the right part of the screen, you can see that the answer defined by AI is returned.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Click the “Entities” menu.
    • You can use it to group words with the same meaning and label them.
  • Click “CREATE ENTITY” at the top of the screen.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Enter “Entity name”.
    • This is just a collection of “entry” to register. Therefore, set an arbitrary name.Dialogflow QuickStart
      Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Define “Entry”. Define a base label on the left and a word with the same meaning on the right.
    • The following defines “artificial intelligence” as a word with the same meaning as the label “AI”.Dialogflow QuickStart
      Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Open the “Intent” screen where you want to use the registered “Entry”.
  • First, do not set “Entity”. In that state, try to test the user’s question of “Intent” which is replaced with the word defined in “Entity”.
    • In the example below, the question “What is AI?” is replaced with “What is artificial intelligence?” And we are testing.
  • If “Entity” is not set, AI will reply if the question is not understood.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • If you drag the word in “Training phrases” you want to set “Entity”, the candidates for “Entity” will be displayed. Select the “Entity” you want to set.
    • In the example below, we set the “Technology” of “Entity” to the word “AI”.Dialogflow QuickStart
      Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Click “SAVE” at the top of the screen.
  • Test again on the right side of the screen.
    • In the example below, AI answers the question “What is artificial intelligence?”, which is defined by “Intent”. This means that the question was judged to be the same as “What is AI?”.Dialogflow QuickStart
      Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • This completes the development of interactive AI.

AI Assistant Release

  • Click on the “Integrations” menu.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • The following is a list of release destinations.
  • Turn on “Web Demo” when releasing as a Web service embedded in a website.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • The “Web Demo” screen is displayed.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • Change the release URL if necessary.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  • When you access the set URL, a demo screen will be displayed. You can test the behavior.Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  •  If there is no problem in operation, install the iframe of the following screen on the website where you want to install AI Assistant. Dialogflow QuickStart
    Google and Dialogflow™ are trademarks of Google LLC and this website is not endorsed by or affiliated with Google in any way.
  •  As an example, it can be installed on the website as follows.
  • This completes the release of the AI assistant that runs the interactive AI.

This knowledge describes how to create interactive AI and AI assistants, but these are only early templates.
By enriching the backend based on this AI, we can evolve it into advanced AI.
NagareLab Assistant will also evolve in the future.

 

Sponsored Links
You have been blocked from seeing ads.