# How to use Rules in Conversations

When conversations are complex and responses to questions depend on attributes in external information we can make use of rules to navigate the user to the right conversation response.

Rules allow you to define segmented conversation responses based on a defined criteria.&#x20;

### Adding Rules

1. Rules can be authored by dragging the ***Rule*** node on to the flow builder.&#x20;
2. On the right panel you can add a rule by entering a name for your rule.
3. Once you add the rule click on the name of the rule you added to define the criteria for it.\ <br>

   <figure><img src="/files/oIHOboZS96XFzSQmcGbK" alt=""><figcaption></figcaption></figure>

### Authoring Rule Criteria

Each rule criteria is composed of one or more conditions and for each of the conditions you can do the following:

* Check all of the conditions (**AND** operation) - In this mode all conditions need to hold true for the rule to be true
* Check any of the conditions (**OR** operation) - In this mode any of the condition needs to be true for the rule to be true

The rule condition is composed of three parts:

1. Parameter Field Name
2. Operator
3. Field Value

#### Adding Conditions

| **Operator** | **Supported Types**   |
| ------------ | --------------------- |
| Not Equals   | Number, Text, Boolean |
| Equals       | Number, Text, Boolean |
| Greater Than | Number                |
| Less Than    | Number                |
| Contains     | Text                  |
| Is Not Empty | Text, List            |
| Is Empty     | Text, List            |

{% embed url="<https://player.vimeo.com/video/631335378>" %}

<br>


---

# 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://docs.deepconverse.com/product-docs/conversational-flow-builder/how-to-use-rules-in-conversations.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.
