{"__v":0,"_id":"5845a4a99f6fbb1b004307f1","category":{"version":"5845a4a89f6fbb1b004307b7","project":"54d3007669578e0d002730c9","_id":"5845a4a89f6fbb1b004307b9","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-30T06:25:25.645Z","from_sync":false,"order":1,"slug":"key-concepts","title":"Key Concepts"},"parentDoc":null,"project":"54d3007669578e0d002730c9","user":"55bafe141b0d663700781682","version":{"__v":1,"_id":"5845a4a89f6fbb1b004307b7","project":"54d3007669578e0d002730c9","createdAt":"2016-12-05T17:32:24.708Z","releaseDate":"2016-12-05T17:32:24.708Z","categories":["5845a4a89f6fbb1b004307b8","5845a4a89f6fbb1b004307b9","5845a4a89f6fbb1b004307ba","5845a4a89f6fbb1b004307bb","5845a4a89f6fbb1b004307bc","5845a4a89f6fbb1b004307bd","5845a4a89f6fbb1b004307be","5845a4a89f6fbb1b004307bf","5845a4a89f6fbb1b004307c0"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"25.0.0","version":"25"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-08-03T13:11:25.702Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"* [Overview](#overview)\n* [User says](#user-says)\n * [Example (“) and Template (:::at:::) Modes](#section-example-and-template-modes)\n * [Example Annotation](#section-example-annotation)\n     + [Automatic Annotation](#section-automatic-annotation)\n     + [Editing Automatically Annotated Examples](#section-editing-automatically-annotated-examples)\n     + [Manual Annotation](#section-manual-annotation)\n * [Search Option](#section-search-option)\n* [Action](#action)\n* [Response](#response)\n * [Text Response](#section-text-response) \n     + [References to Parameter Values](#section-references-to-parameter-values)\n     + [Special Characters](#section-special-characters)\n     + [Handling Empty Parameter Values](#section-handling-empty-parameter-values)\n     + [Emojis](#section-emojis) \n * [Rich Messages](#section-rich-messages)\n* [Contexts](#contexts)\n* [Intents Priority](#intents-priority)\n* [Fallback Intent](#fallback-intent)\n * [Fallback Intents Overview](#section-fallback-intents-overview)\n * [Referencing Parameter Values in Fallback Intents](#section-referencing-parameter-values-in-fallback-intents)\n* [Download and Upload Intents](#download-and-upload-intents) \n * [Download Intents](#section-download-intents)\n * [Upload Intents](#section-upload-intents) \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Overview\"\n}\n[/block]\nAn **intent** represents a mapping between what a user says and what action should be taken by your software.\n\nIntent interfaces have the following sections:\n\n* User says\n* Action\n* Response\n* Contexts\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"User says\"\n}\n[/block]\n##Example (“) and Template (@) Modes\n\nEach ‘User says’ expression can be in one of two modes: Example Mode (indicated by the <code>“</code> icon) or Template Mode (indicated by the <code>@</code> icon).\n\n**Examples** are written in natural language and annotated so that parameter values can be extracted. You can read more on annotation below.\n\n**Templates** contain direct references to <a href=\"https://docs.api.ai/docs/concept-entities\" target=\"_blank\">entities</a> instead of annotations, i.e., entity names are prefixed with the <code>@</code> sign.\n\nTo toggle between modes, click on the <code>“</code> or <code>@</code> icon. \n\nWe recommend using examples rather than templates, because it’s easier and Machine Learning learns faster this way. And remember: the more examples you add, the smarter your agent becomes.\n\n##Example Annotation\n\n**Annotation** is a process (and also the result of such process) of linking a word (or phrase) to an entity. \n\n###Automatic Annotation\n\nWhen you add examples to the ‘User says’ section, they are annotated automatically. The system detects the correspondence between words (or phrases) and existing developer and system entities and highlights such words and phrases. It also automatically assigns a parameter name to each detected entity.\n\n###Editing Automatically Annotated Examples\n\nYou can edit the linked entity and the parameter name assigned to it in either the review window that opens when you click on the annotated example, or the parameter table of the ‘Action’ section. \n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/a051c07-Intents-review-win-and-param-table.png\",\n        \"Intents-review-win-and-param-table.png\",\n        2076,\n        1450,\n        \"#f8f8f7\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nThe results of the automatic annotation in the review window and parameter table are synchronized. If you change something in the review window, the respective changes will automatically occur in the parameter table, and vice versa.\n\nNote that changes made in the review window and in the parameter table have different scopes: \n\n* Changes in the review window won’t affect other examples containing the same annotations.\n* Changes in the parameter table will affect all ‘User says’ examples with the same annotation.  \n\nYou can do 3 type of changes:\n\n* Assign a different entity to an annotated part of the example\n* Edit the parameter name\n* Delete the annotation (i.e., delete the link between the word and the entity).\n\n**Local changes (in one example)**\n\n  * To assign a different entity to the annotation in one example, click on the highlighted phrase. A pop-up window will appear, where you can choose from the list of existing system or developer entities. \n  * In order to change a parameter name in one example, click on the example and edit the parameter name in the review window. \n  * To delete the annotation, click on either the bin icon in the pop-up window or the <code>x</code> icon of the corresponding row in the review window.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/368a601-Intents_local-changes.png\",\n        \"Intents_local-changes.png\",\n        2084,\n        1352,\n        \"#f7f8f7\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\n**Changes for entire intent (in the parameter table)**\n\n- To assign a different entity to the parts highlighted with the same color in all examples, click on the entity in the parameter table. In the pop-up window, choose from the list of the existing system or developer entities. \n\n- To change the parameter name for the annotations through all examples, edit the parameter name in the parameter table.\n\n- To delete a particular annotation from all examples, click on the menu icon on the right side of the respective row in the parameter table and select ‘Delete’ from the drop-down menu.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0adc53a-Intents_global-changes.png\",\n        \"Intents_global-changes.png\",\n        2224,\n        1409,\n        \"#f7f7f6\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\n###Manual Annotation\n\nIf necessary, you can annotate examples manually by selecting a word or phrase and choosing an existing entity or creating a new one in the pop-up window. \n\n## Search Option\n\nIf you need to find a specific example or template, you can search for keywords in the 'User says' section. \n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f946e0f-User-says_Search-option.png\",\n        \"User-says_Search-option.png\",\n        2098,\n        562,\n        \"#2b91c7\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Action\"\n}\n[/block]\nThis section consists of the action name field and the parameter table. \n\nThe **action name** is defined manually. It will be the trigger word for your app to perform a particular action. \n\n**Parameters** can be filled in automatically from the ‘Users says’ examples and templates, or added manually.\n\nRead more in <a href=\"https://docs.api.ai/docs/concept-actions\" target=\"_blank\">Action and Parameters</a>.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response\"\n}\n[/block]\nIn this section, you can define **your agent’s responses** which will be provided by your application when the intent is triggered.\n\n## Text Response\n\nYou can improve your agent eloquence by adding several variations of the text response per intent. When the same intent has been triggered more than once, different text response variations will be unrepeatable until all options have been used. It'll help make your agent speech more human-like. \n\n### References to Parameter Values\n\nResponses can contain **references to parameter values**.\n\nIf a parameter is present in the parameter table, use the following format to refer to its value in the ‘Text response’ field: `$parameter_name`.\n\nThere are special parameter value types that don’t appear automatically in the parameter table.\n\nIf you need to refer to such a special type of value, you'll have to add a new parameter to the parameter table, define its value manually, and then reference it in the response as <code>$parameter_name</code>.\n\nUse the following formats:\n\n- <code>$parameter_name.original</code> – to refer to the original value of the parameter \n\n- <code>$parameter_name_for_composite_entity.inner_alias</code> – to refer to a value of one of the composite entity components\n\n- <code>#context_name.parameter_name</code> – to reference a parameter value collected in some other intent with defined context\n\n### Special Characters\n\nIf you need the **dollar sign `$`** or the **number sign `#`** to appear in your agent's text response, use braces around the value that follows `$` or `#`.\nFor example:\n`${100}` – where `100` is a constant value\n`${$number}` – where `$number` is a reference to the parameter value\n`#{channel}` – where `channel` is a string\n`#{#channel.name}` – where `#channel.name` is the reference to the parameter value \"name\" from the context \"channel\"\n\nIf you need to use braces in text responses, use double braces: `{{` will be displayed as `{` and `}}` will be displayed as `}`.\n\n### Handling Empty Parameter Values\n\nIf an intent is designed in such a way that some parameters can return empty values after the intent has been triggered, the variants of Text response that contain references to the parameters with empty values won't be given as text responses. Make sure to define different variations of Text response for such intents.\n\nFor example, if an intent has 2 parameters and may return both or any of them with empty value, and you want to reference parameter values in Text response, make sure to define at least 4 variants of Text response:\n\n- referencing both parameter values,\n- referencing the 1st parameter value,\n- referencing the 2nd parameter value,\n- without any reference to the parameter values.\n\n### Emojis\n\nIf you want your agent to display emojis in responses, just copy and paste a desired emoji in the 'Response' field.\n\n## Rich Messages\n\nIf you use one of the following one-click integrations – Facebook Messenger, Kik, Slack, or Telegram – you can define your bot responses as rich messages (images, cards, quick replies etc.) directly in intents.\n\nFor more information, please read the <a href=\"https://docs.api.ai/docs/rich-messages\" target=\"_blank\">documentation on Rich Messages</a>.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Contexts\"\n}\n[/block]\n**Contexts** are designed for passing on information from previous conversations or external sources (e.g., user profile, device information, etc). Also, they can be used to manage conversation flow. \n\nTo define the contexts, click on ‘Define contexts’ right below the intent name. \n\nInput contexts serve as a prerequisite for the intent to be matched; i.e., the intent will participate in matching only when **all** the contexts in the input context field are active.\n\n <a href=\"https://docs.api.ai/docs/concept-contexts\" target=\"_blank\">Read more on Contexts</a>.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Intents Priority\"\n}\n[/block]\nIntent priority allows to assign more weight to one of the intent in case an input phrase matches multiple intents. Intents priority can be changed by clicking on the blue (default) dot on the left of the intent name and selecting the priority from the drop-down menu. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/633a9a2-Intent-priority-new.gif\",\n        \"Intent-priority-new.gif\",\n        1030,\n        336,\n        \"#309be0\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Fallback Intent\"\n}\n[/block]\n## Fallback Intents Overview\n\nFallback intents are triggered if a user's input is not matched by any of the regular intents or enabled domains. \n\nWhen you create a new agent, a default fallback intent is created automatically. You can modify or delete it if you wish. \n\nIf you’d like to create contingency actions or responses for various input contexts, you can add your own fallback intents. Make sure to set a unique set of input contexts for each fallback intent.\n\nTo add a new fallback intent:\n\n- Go to 'Intents' from the left side menu\n- Click on the tree dot “more options” menu next to ‘Create Intent’\n- Choose ‘Create Fallback Intent’\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/53d32b8-Default_fallback_intent_add.png\",\n        \"Default_fallback_intent_add.png\",\n        2386,\n        728,\n        \"#2b87b3\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nFallback intents can reference parameter values from context directly in the ‘Text response’ field in this format: `#context_name.parameter_name`. See example [below](#section-referencing-parameter-values-in-fallback-intents).\n\nIf you’d like certain phrases and their variations to be classified as a fallback intent, you need to create a regular intent, add those phrases to the ‘User says’ section, and define the same action and Text response as in the fallback intent.\n\n## Referencing Parameter Values in Fallback Intents\n\nThe following example shows how to use parameter values from context in the fallback intent. \n\nFirst, we create a regular intent, ‘Greetings’, and collect the user’s name in the parameter ‘user-name’ using the slot filling feature. We also define an output context ‘greetings’ to store the parameter value.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/c0dc937-Fallback-intent-store-user-name.png\",\n        \"Fallback-intent-store-user-name.png\",\n        2274,\n        1312,\n        \"#f7f8f8\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nThen, we make some modifications in the Default Fallback Intent which was automatically created with the agent. We’ll reference the user’s name as `#greetings.user-name` in the Text response variations. To keep the ‘greetings’ context alive, we add it as an output context to this intent as well.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/fc6f0aa-Default-fallback-intent-modified.png\",\n        \"Default-fallback-intent-modified.png\",\n        2118,\n        1216,\n        \"#fafafa\"\n      ]\n    }\n  ]\n}\n[/block]\nNow, any input other than greetings will be classified as Default Fallback Intent.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0051d54-fallback-intent-name.gif\",\n        \"fallback-intent-name.gif\",\n        325,\n        694,\n        \"#f2f2f2\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Download and Upload Intents\"\n}\n[/block]\n## Download Intents\n\nYou can download intents in JSON format. To do so, go to 'Intents' from the left side menu, move the cursor over the intent, and click the little cloud sign.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/c681dc2-intents_download.png\",\n        \"intents_download.png\",\n        2142,\n        546,\n        \"#2b92c4\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\n## Upload Intents\n\nYou can upload intents as JSON files containing <a href=\"https://docs.api.ai/docs/intents#intent-object\" target=\"_blank\">intent object</a>. To do so, click on the 'More options' button next to the 'Create Intent' button, choose 'Upload intent', and follow the instructions on the page.\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/5d57240-intents_upload.png\",\n        \"intents_upload.png\",\n        2180,\n        444,\n        \"#f5f6f6\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"concept-intents","type":"basic","title":"Intents"}
* [Overview](#overview) * [User says](#user-says) * [Example (“) and Template (@) Modes](#section-example-and-template-modes) * [Example Annotation](#section-example-annotation) + [Automatic Annotation](#section-automatic-annotation) + [Editing Automatically Annotated Examples](#section-editing-automatically-annotated-examples) + [Manual Annotation](#section-manual-annotation) * [Search Option](#section-search-option) * [Action](#action) * [Response](#response) * [Text Response](#section-text-response) + [References to Parameter Values](#section-references-to-parameter-values) + [Special Characters](#section-special-characters) + [Handling Empty Parameter Values](#section-handling-empty-parameter-values) + [Emojis](#section-emojis) * [Rich Messages](#section-rich-messages) * [Contexts](#contexts) * [Intents Priority](#intents-priority) * [Fallback Intent](#fallback-intent) * [Fallback Intents Overview](#section-fallback-intents-overview) * [Referencing Parameter Values in Fallback Intents](#section-referencing-parameter-values-in-fallback-intents) * [Download and Upload Intents](#download-and-upload-intents) * [Download Intents](#section-download-intents) * [Upload Intents](#section-upload-intents) [block:api-header] { "type": "basic", "title": "Overview" } [/block] An **intent** represents a mapping between what a user says and what action should be taken by your software. Intent interfaces have the following sections: * User says * Action * Response * Contexts [block:api-header] { "type": "basic", "title": "User says" } [/block] ##Example (“) and Template (@) Modes Each ‘User says’ expression can be in one of two modes: Example Mode (indicated by the <code>“</code> icon) or Template Mode (indicated by the <code>@</code> icon). **Examples** are written in natural language and annotated so that parameter values can be extracted. You can read more on annotation below. **Templates** contain direct references to <a href="https://docs.api.ai/docs/concept-entities" target="_blank">entities</a> instead of annotations, i.e., entity names are prefixed with the <code>@</code> sign. To toggle between modes, click on the <code>“</code> or <code>@</code> icon. We recommend using examples rather than templates, because it’s easier and Machine Learning learns faster this way. And remember: the more examples you add, the smarter your agent becomes. ##Example Annotation **Annotation** is a process (and also the result of such process) of linking a word (or phrase) to an entity. ###Automatic Annotation When you add examples to the ‘User says’ section, they are annotated automatically. The system detects the correspondence between words (or phrases) and existing developer and system entities and highlights such words and phrases. It also automatically assigns a parameter name to each detected entity. ###Editing Automatically Annotated Examples You can edit the linked entity and the parameter name assigned to it in either the review window that opens when you click on the annotated example, or the parameter table of the ‘Action’ section. [block:image] { "images": [ { "image": [ "https://files.readme.io/a051c07-Intents-review-win-and-param-table.png", "Intents-review-win-and-param-table.png", 2076, 1450, "#f8f8f7" ], "sizing": "full" } ] } [/block] The results of the automatic annotation in the review window and parameter table are synchronized. If you change something in the review window, the respective changes will automatically occur in the parameter table, and vice versa. Note that changes made in the review window and in the parameter table have different scopes: * Changes in the review window won’t affect other examples containing the same annotations. * Changes in the parameter table will affect all ‘User says’ examples with the same annotation. You can do 3 type of changes: * Assign a different entity to an annotated part of the example * Edit the parameter name * Delete the annotation (i.e., delete the link between the word and the entity). **Local changes (in one example)** * To assign a different entity to the annotation in one example, click on the highlighted phrase. A pop-up window will appear, where you can choose from the list of existing system or developer entities. * In order to change a parameter name in one example, click on the example and edit the parameter name in the review window. * To delete the annotation, click on either the bin icon in the pop-up window or the <code>x</code> icon of the corresponding row in the review window. [block:image] { "images": [ { "image": [ "https://files.readme.io/368a601-Intents_local-changes.png", "Intents_local-changes.png", 2084, 1352, "#f7f8f7" ], "sizing": "full" } ] } [/block] **Changes for entire intent (in the parameter table)** - To assign a different entity to the parts highlighted with the same color in all examples, click on the entity in the parameter table. In the pop-up window, choose from the list of the existing system or developer entities. - To change the parameter name for the annotations through all examples, edit the parameter name in the parameter table. - To delete a particular annotation from all examples, click on the menu icon on the right side of the respective row in the parameter table and select ‘Delete’ from the drop-down menu. [block:image] { "images": [ { "image": [ "https://files.readme.io/0adc53a-Intents_global-changes.png", "Intents_global-changes.png", 2224, 1409, "#f7f7f6" ], "sizing": "full" } ] } [/block] ###Manual Annotation If necessary, you can annotate examples manually by selecting a word or phrase and choosing an existing entity or creating a new one in the pop-up window. ## Search Option If you need to find a specific example or template, you can search for keywords in the 'User says' section. [block:image] { "images": [ { "image": [ "https://files.readme.io/f946e0f-User-says_Search-option.png", "User-says_Search-option.png", 2098, 562, "#2b91c7" ], "sizing": "full" } ] } [/block] [block:api-header] { "type": "basic", "title": "Action" } [/block] This section consists of the action name field and the parameter table. The **action name** is defined manually. It will be the trigger word for your app to perform a particular action. **Parameters** can be filled in automatically from the ‘Users says’ examples and templates, or added manually. Read more in <a href="https://docs.api.ai/docs/concept-actions" target="_blank">Action and Parameters</a>. [block:api-header] { "type": "basic", "title": "Response" } [/block] In this section, you can define **your agent’s responses** which will be provided by your application when the intent is triggered. ## Text Response You can improve your agent eloquence by adding several variations of the text response per intent. When the same intent has been triggered more than once, different text response variations will be unrepeatable until all options have been used. It'll help make your agent speech more human-like. ### References to Parameter Values Responses can contain **references to parameter values**. If a parameter is present in the parameter table, use the following format to refer to its value in the ‘Text response’ field: `$parameter_name`. There are special parameter value types that don’t appear automatically in the parameter table. If you need to refer to such a special type of value, you'll have to add a new parameter to the parameter table, define its value manually, and then reference it in the response as <code>$parameter_name</code>. Use the following formats: - <code>$parameter_name.original</code> – to refer to the original value of the parameter - <code>$parameter_name_for_composite_entity.inner_alias</code> – to refer to a value of one of the composite entity components - <code>#context_name.parameter_name</code> – to reference a parameter value collected in some other intent with defined context ### Special Characters If you need the **dollar sign `$`** or the **number sign `#`** to appear in your agent's text response, use braces around the value that follows `$` or `#`. For example: `${100}` – where `100` is a constant value `${$number}` – where `$number` is a reference to the parameter value `#{channel}` – where `channel` is a string `#{#channel.name}` – where `#channel.name` is the reference to the parameter value "name" from the context "channel" If you need to use braces in text responses, use double braces: `{{` will be displayed as `{` and `}}` will be displayed as `}`. ### Handling Empty Parameter Values If an intent is designed in such a way that some parameters can return empty values after the intent has been triggered, the variants of Text response that contain references to the parameters with empty values won't be given as text responses. Make sure to define different variations of Text response for such intents. For example, if an intent has 2 parameters and may return both or any of them with empty value, and you want to reference parameter values in Text response, make sure to define at least 4 variants of Text response: - referencing both parameter values, - referencing the 1st parameter value, - referencing the 2nd parameter value, - without any reference to the parameter values. ### Emojis If you want your agent to display emojis in responses, just copy and paste a desired emoji in the 'Response' field. ## Rich Messages If you use one of the following one-click integrations – Facebook Messenger, Kik, Slack, or Telegram – you can define your bot responses as rich messages (images, cards, quick replies etc.) directly in intents. For more information, please read the <a href="https://docs.api.ai/docs/rich-messages" target="_blank">documentation on Rich Messages</a>. [block:api-header] { "type": "basic", "title": "Contexts" } [/block] **Contexts** are designed for passing on information from previous conversations or external sources (e.g., user profile, device information, etc). Also, they can be used to manage conversation flow. To define the contexts, click on ‘Define contexts’ right below the intent name. Input contexts serve as a prerequisite for the intent to be matched; i.e., the intent will participate in matching only when **all** the contexts in the input context field are active. <a href="https://docs.api.ai/docs/concept-contexts" target="_blank">Read more on Contexts</a>. [block:api-header] { "type": "basic", "title": "Intents Priority" } [/block] Intent priority allows to assign more weight to one of the intent in case an input phrase matches multiple intents. Intents priority can be changed by clicking on the blue (default) dot on the left of the intent name and selecting the priority from the drop-down menu. [block:image] { "images": [ { "image": [ "https://files.readme.io/633a9a2-Intent-priority-new.gif", "Intent-priority-new.gif", 1030, 336, "#309be0" ], "sizing": "full" } ] } [/block] [block:api-header] { "type": "basic", "title": "Fallback Intent" } [/block] ## Fallback Intents Overview Fallback intents are triggered if a user's input is not matched by any of the regular intents or enabled domains. When you create a new agent, a default fallback intent is created automatically. You can modify or delete it if you wish. If you’d like to create contingency actions or responses for various input contexts, you can add your own fallback intents. Make sure to set a unique set of input contexts for each fallback intent. To add a new fallback intent: - Go to 'Intents' from the left side menu - Click on the tree dot “more options” menu next to ‘Create Intent’ - Choose ‘Create Fallback Intent’ [block:image] { "images": [ { "image": [ "https://files.readme.io/53d32b8-Default_fallback_intent_add.png", "Default_fallback_intent_add.png", 2386, 728, "#2b87b3" ], "sizing": "full" } ] } [/block] Fallback intents can reference parameter values from context directly in the ‘Text response’ field in this format: `#context_name.parameter_name`. See example [below](#section-referencing-parameter-values-in-fallback-intents). If you’d like certain phrases and their variations to be classified as a fallback intent, you need to create a regular intent, add those phrases to the ‘User says’ section, and define the same action and Text response as in the fallback intent. ## Referencing Parameter Values in Fallback Intents The following example shows how to use parameter values from context in the fallback intent. First, we create a regular intent, ‘Greetings’, and collect the user’s name in the parameter ‘user-name’ using the slot filling feature. We also define an output context ‘greetings’ to store the parameter value. [block:image] { "images": [ { "image": [ "https://files.readme.io/c0dc937-Fallback-intent-store-user-name.png", "Fallback-intent-store-user-name.png", 2274, 1312, "#f7f8f8" ], "sizing": "full" } ] } [/block] Then, we make some modifications in the Default Fallback Intent which was automatically created with the agent. We’ll reference the user’s name as `#greetings.user-name` in the Text response variations. To keep the ‘greetings’ context alive, we add it as an output context to this intent as well. [block:image] { "images": [ { "image": [ "https://files.readme.io/fc6f0aa-Default-fallback-intent-modified.png", "Default-fallback-intent-modified.png", 2118, 1216, "#fafafa" ] } ] } [/block] Now, any input other than greetings will be classified as Default Fallback Intent. [block:image] { "images": [ { "image": [ "https://files.readme.io/0051d54-fallback-intent-name.gif", "fallback-intent-name.gif", 325, 694, "#f2f2f2" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Download and Upload Intents" } [/block] ## Download Intents You can download intents in JSON format. To do so, go to 'Intents' from the left side menu, move the cursor over the intent, and click the little cloud sign. [block:image] { "images": [ { "image": [ "https://files.readme.io/c681dc2-intents_download.png", "intents_download.png", 2142, 546, "#2b92c4" ], "sizing": "full" } ] } [/block] ## Upload Intents You can upload intents as JSON files containing <a href="https://docs.api.ai/docs/intents#intent-object" target="_blank">intent object</a>. To do so, click on the 'More options' button next to the 'Create Intent' button, choose 'Upload intent', and follow the instructions on the page. [block:image] { "images": [ { "image": [ "https://files.readme.io/5d57240-intents_upload.png", "intents_upload.png", 2180, 444, "#f5f6f6" ], "sizing": "full" } ] } [/block]