# Intent & Context

Intent is one the core module of Smart Replies which helps the NLP & AI engine to take more accurate decisions on which answer is the best match for the user inputs.

Intent understand the intention of your users or topics which they are asking , lets understand with an example&#x20;

I am looking to buy iPhone 10

Whats new features of iPhone 10

Here in both questions the intents is  iPhone 10&#x20;

So against "iPhone 10" category add iPhone 10 as an intent so that the bot understands when a user input matches "iPhone 10" it look up first in the "iPhone 10" category for the most relevant answers and if not found it will start looking up other categories, if not found any relevant answers it will give default reply.

### Adding Intents

You can add intents against each category as shown below

<figure><img src="https://lh7-us.googleusercontent.com/4JbKXjfcKU9yWqwqBSAwUUFOcXEQ3sPcFQnenzd2s_FB-TvZSwMLAd68g2lC99OqpkiPX9pf-ZikEA_mOdwQc_kzbhC6WX2zdqgLrG1hP05T1-PVMV64fv1P1SqcRYjdVGtpZ9EkOtTgNqKHpeyAGns" alt=""><figcaption></figcaption></figure>

Now Add more intents to the iPhone 10 category , you can see we have added 4 intents since iPhone 10 also known as iPhone x and the intents are added with and without spaces like iPhone , iPhone 10 because when user input a space in a sentence it treats as 2 words , if a user types "iPhone" which cant be recognized until you add it.

<figure><img src="https://lh7-us.googleusercontent.com/BYw61vZVYI9P7Wid9-tnklbo-XPZbxrGiGLGmj30nVyYnCAvVFBp2BNheDPJZF8iDDDj39pO1KMCfUmaefc07vQxBUjSgovPD6LDOgDQ2mAShB5B8A01DDAQlYKG1PSAum0u8cGlMICVG1tFcrE1sgQ" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can also add intents with possible spelling errors.&#x20;

Intents are not case sensitive&#x20;

Don't add any questions here , add only keywords.
{% endhint %}

### Lets Explain More with Examples

if you are a mobile phone dealer and have 3 phone models each phone model specs, price, feature may vary from one to another so here you can create categories for each phone model and add your phone model name , number etc as intents against the relevant categories

Now lets say you have 3 phone models to sell then create category and intents as below

| iphone 7 7 | <p>iphone 7 7</p><p>iphone7</p>                                  |
| ---------- | ---------------------------------------------------------------- |
| Category   | Intent                                                           |
| iphone 7 8 | <p>iphone 7 8</p><p>iphone8</p>                                  |
| Iphone 10  | <p>iphone 7 10</p><p>Iphone10</p><p>iphone 7 x</p><p>iphonex</p> |

<br>

{% hint style="info" %}
Add multiple intents only if your product or services are known in different names like here iPhone X also knows as iPhone 10
{% endhint %}

{% hint style="success" %}
**We have now learned how to add intents against each category, now lets learn more about Context**
{% endhint %}

### Now let’s see how context works with intents.

Context helps to remember the last user interaction and reply more intelligently and naturally , Intent and [Question Variations](https://help.pickyassist.com/setting-up-guide/smart-replies/train-module/question-variations) always works together in a conversation with intents, lets explain more with examples;

{% hint style="info" %}
**Do you have an iPhone 10 ?**\
Yes, we do have an iPhone 10.

**Whats price of 64 GB?**\
Its $499 and 10% offer on credit card payments.
{% endhint %}

Have you observed that In the second question the user don’t specify the phone model but from the last question smart reply identified the intent as “iPhone 10” and saved to context so the next question is answered intelligently like a human.

{% hint style="info" %}
We have successfully learned how to Add Intents & How Context Works with Intents, now we need to learn more about [Question Variations ](/setting-up-guide/smart-replies/train-module/question-variations.md)or Training Phrases
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.pickyassist.com/setting-up-guide/smart-reply-v2/train-module/intent-and-context.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
