Create and query your first agent

This page describes how to create and try out your first Dialogflow agent.

Create your first Dialogflow agent

To create a Dialogflow agent:

  1. Open a browser and log in to Dialogflow.
  2. Click Create agent in the left menu.
  3. Enter your agent's name, default language, and default time zone, then click the Create button.

The Dialogflow console

You should now see the Dialogflow console and the menu panel on the left. If you're working on a smaller screen and the menu is hidden, click on the menu menu button in the upper left corner. The settings settings button takes you to the current agent's settings.

The middle of the page will show the list of intents for the agent. By default, Dialogflow agents start with two intents. Your agent matches the Default Fallback Intent when it doesn't understand what your users say. The Default Welcome Intent greets your users. These can be altered to customize the experience.

The Dialogflow simulator is on the right side of the page. The simulator lets you try out your agent by speaking or typing messages.

Query your agent

Agents are best described as NLU (Natural Language Understanding) modules. These can be included in your app, product, or service and transform natural user requests into actionable data.

Time to try out your agent! In the Dialogflow simulator on the right, click into the text field that says Try it now, type anything, and press enter.

You just spoke to your Dialogflow agent! You may notice your agent didn't understand you. Since your input didn't match any intent, the Default Fallback Intent is matched, and you receive one of the default replies inside that intent.

The Default Fallback Intent reply prompts the user to re-frame their query in terms that can be matched. You can change the responses within the Default Fallback Intent to provide example queries and guide the user to make requests that can match an intent.

Create your first intent

Dialogflow uses intents to categorize a user's intentions. Intents have Training Phrases, which are examples of what a user might say to your agent. For example, someone wanting to know the name of your agent might ask, "What is your name?", "Do you have a name?", or just say "name". All of these queries are unique but have the same intention: to get the name of your agent.

To cover this query, create an intent by following these steps:

  1. Click on the plus add next to Intents in the left menu.

  2. Add the name "name" into the Intent name text field.

  3. In the Training Phrases section, click on the text field and enter the following, pressing enter after each entry:

    • What is your name?
    • Do you have a name?
    • name
  4. In the Responses section, click on the text field and enter the following response:

    • My name is Dialogflow!
  5. Click the Save button.

Try it out!

Now try asking your agent for its name. In the simulator on the right, type "What's your name?" and press enter.

Your agent responds to the query correctly, even though your query was a little different from the training phrase ("What's your name?" versus "What is your name?"). It was able to resolve this by using machine learning.

Dialogflow uses training phrases as examples for a machine learning model to match users' queries to the correct intent. The machine learning model checks the query against every intent in the agent, gives every intent a score, and the highest-scoring intent is matched. If the highest scoring intent has a very low score, the fallback intent is matched.

Next steps

If you have any questions or thoughts, let us know on the Dialogflow Google Plus Community. We'd love to hear from you!

You might also want to check out: