> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-agent-management-platform-dev.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Dialogflow Engine

<Badge icon="arrow-left" color="gray">[Back to External NLU Integrations](/ai-for-service/integrations/overview#external-nlu)</Badge>

The Dialogflow ES adapter uses NLP and machine learning to identify user intent and extract entities. This page covers how to create and train a Dialogflow agent, enable the Dialogflow API, and generate service account credentials for use in the Kore.ai External NLU adapter settings.

Once configured, you can [test the conversation behavior](test-and-debug.md) of your AI Agent using your Dialogflow ES model.

***

## Train the Dialogflow Engine

**Prerequisites:** At least one agent created on [Dialogflow Essentials](https://dialogflow.cloud.google.com/). Intent and entity names in Dialogflow must match those defined in the Kore.ai XO Platform.

To configure the Dialogflow ES adapter, you need the **Project ID** and **Private Key** from your Google Cloud service account JSON file. See [Enable the Dialogflow API](#enable-the-dialogflow-api) and [Create Service Account Credentials](#create-service-account-credentials).

### Create and Train an Agent

1. Go to [Dialogflow Essentials](https://dialogflow.cloud.google.com/) and click **Create Agent**. In this example, the agent is named `Test_Dialogflow`.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img1.png" alt="Create an agent" />

2. Click **Create Intent** and name it to match the intent in your AI Agent.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img2.png" alt="Create an intent with the same name as in your App" />

3. In this example, the intent is named `Phone Number Verification` to match the corresponding intent in the AI Agent.

4. Under **Action and Parameters**, add the action name matching the entity, then fill in **Parameter Name**, **Entity**, **Value**, and **Prompt**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img3.png" alt="Add action, parameter, entity, value, prompt" />

5. Under **Responses > Default**, add the **Text Response** to display to the user.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img4.png" alt="Add text response" />

6. Click **Save**.

7. Go to **Training** in the left menu and enter the intent name under **User Says**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img5.png" alt="Go to Training and enter Intent name" />

8. In the **Try Now** panel (top right), enter the intent name to test the configuration.

9. The configured text response appears under **Default Response**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img6.png" alt="Configured text response displayed under Default Response" />

   <Note>You can configure any intents, entities, or FAQ details you need to identify using the Dialogflow ES adapter.</Note>

***

## Enable the Dialogflow API

1. Click the **Gear** icon next to the agent name in the Dialogflow dashboard.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img7.png" alt="Click the Gear icon next to the agent name" />

2. On the **General Settings** page, scroll down to find the **Project ID**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img8.png" alt="Note the project ID" />

   <Note>The Project ID is required when configuring the Dialogflow ES adapter on the Kore.ai platform.</Note>

3. Click the Project ID to open Google Cloud.

4. In the Google Cloud dashboard, go to **APIs & Services > Enabled APIs & Services**.

5. Click **+ Enable APIs and Services** and search for **Dialogflow API**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img9.png" alt="Click Enable APIs and Services" />

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img10.png" alt="Find Dialogflow API option" />

6. After activating the Dialogflow API, click **Manage** to open the API management dashboard.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img11.png" alt="Dialogflow API management dashboard" />

***

## Create Service Account Credentials

### Create a Service Account

1. Click **Create Credentials** at the top of the Dialogflow API management dashboard.

   <Note>If you already have service accounts, access them from **Credentials** in the left navigation menu.</Note>

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img12.png" alt="Click 'Create Credentials'" />

2. On the **Create Credentials** page, **Dialogflow API** is pre-selected in the **Select an API** dropdown.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img13.png" alt="Dialogflow API is by default selected" />

3. For **What data will you be accessing?**, select **Application Data**. Click **Next**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img14.png" alt="Application Data selected" />

4. Select **No, I'm not using them** and click **Next**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img15.png" alt="No, I'm not using them" />

5. Fill in the service account name, ID, and description.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img16.png" alt="Service account details" />

6. Click **Create and Continue**.

7. Grant the required access permissions and user access on the subsequent pages.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img17.png" alt="Grant permission to Service Account" />

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img18.png" alt="Grant permission to User" />

### Generate a Private Key

1. Click the service account under **Service Accounts** in **APIs & Services**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img19.png" alt="Click on the Service account" />

2. Go to the **Keys** tab.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img20.png" alt="Service account details - Keys tab" />

3. In the **Add Key** dropdown, select **Create a new key**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img21.png" alt="Create a new private key" />

4. Select **JSON** and confirm.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img22.png" alt="JSON option to create Private key" />

   <Note>JSON is selected by default.</Note>

A JSON file is downloaded to your computer.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-agent-management-platform-dev/ai-for-service/integrations/images/external-nlu-dialogflow-engine-img23.png" alt="JSON Private Key information downloaded" />

The file structure:

```json  theme={null}
{
  "type": "***",
  "project_id": "***",
  "private_key_id": "***",
  "private_key": "***",
  "client_email": "***",
  "client_id": "***",
  "auth_uri": "***",
  "token_uri": "***",
  "auth_provider_x509_cert_url": "***",
  "client_x509_cert_url": "***"
}
```

<Note>
  Save this JSON file securely — you cannot access it again. Copy the entire contents into the **Private Key** field in the Kore.ai External NLU adapter settings.
</Note>

***

To validate the Dialogflow NLU configuration, see [Test and Debug](test-and-debug.md).


Built with [Mintlify](https://mintlify.com).