> For the complete documentation index, see [llms.txt](https://docs.borndigital.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.borndigital.ai/digital-agent/chat-bubble/rating-answers.md).

# Rating answers

Let customers rate the agent's answers with a thumbs up or down – in the whole bubble or only in chosen parts of a flow – and find every rating in Kibana.

With rating on, a **thumbs up** and a **thumbs down** appear below the agent's answers in the chat bubble. The customer rates an answer with one click; the chosen thumb stays highlighted and the other one disappears. Every rating is saved together with the answer it belongs to, so you see exactly which answer, in which node and which project, customers liked or disliked.

<figure><img src="https://4261467870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6iQTvxgRZRwPS1NgIGEb%2Fuploads%2F7TM0HCqYFXA6k1Pq2Gr9%2Fbubble-rating-thumbs.png?alt=media" alt="The DA Bubble with Rate response on: like and dislike thumbs below every answer, the thumbs of the last answer highlighted"><figcaption><p>Rating thumbs below the agent's answers</p></figcaption></figure>

## Two ways to turn it on

| You want ratings…                    | Where you set it                                  | Bubble switch **Rate response** |
| ------------------------------------ | ------------------------------------------------- | ------------------------------- |
| under **every** answer of the bubble | **Bubble design**                                 | on                              |
| only in **some parts** of a project  | the variable `message_rating_enabled` in the flow | off                             |

The variable always wins: for the answers where the flow sets it, the bubble switch does not matter.

## Rate every answer in a bubble

1. Open **Organization** › **Bubble design** and **Choose** the bubble.
2. On the **Set-up** tab, turn on **Rate response** under **Extras**.
3. Click **Apply** and **Save**. If the bubble is already deployed, confirm the deployment.
4. Reload the web page with the bubble – the thumbs appear below the agent's answers.

<figure><img src="https://4261467870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6iQTvxgRZRwPS1NgIGEb%2Fuploads%2Fgit-blob-952d80b069e3452bb2fbdd4abfafba0fdc8c342b%2Fbubble-design-setup.png?alt=media" alt="Bubble design, Set-up tab, with the Extras switches including Rate response"><figcaption><p>Rate response in Set-up › Extras</p></figcaption></figure>

To stop collecting ratings, turn **Rate response** off the same way. The thumbs disappear; ratings that customers have already given stay in Kibana.

## Rate only some parts of a project

Often you want feedback only on certain answers – for example the answers of an AI node, but not the menu, the verification form or the goodbye message. Then:

{% hint style="info" %}
Leave **Rate response** **off** in the bubble and switch the rating on and off in the project with the variable `message_rating_enabled`.
{% endhint %}

1. Open the node whose answer customers should rate – for example the AI node that answers questions.
2. In **Variables**, click **Add** and set `message_rating_enabled` to `True`.
3. In the first node where the rated part ends – for example the menu, the transfer to an operator or the end of the chat – set `message_rating_enabled` to `False`.

Step 3 matters: the variable keeps its value for the rest of the conversation until another node changes it. Without it, every following answer would show the thumbs as well.

| Value of `message_rating_enabled` | Thumbs below the answer                              |
| --------------------------------- | ---------------------------------------------------- |
| `True`                            | Shown, even if the bubble has **Rate response** off. |
| `False`                           | Hidden, even if the bubble has **Rate response** on. |
| `""` (empty text)                 | The bubble setting applies again.                    |
| not set                           | The bubble setting applies.                          |

It works the other way round too: keep **Rate response** on in the bubble, set `False` in the nodes that should not be rated – forms, verification codes, technical messages – and `""` in the node after them.

{% hint style="warning" %}

* Write `True` and `False` **without quotes**. `"True"` in quotes is text, and the bubble then uses its own setting.
* To return to the bubble setting, use `""`. Setting `None` does not change the variable.
* If any variable in the project is marked **Api editable** (see **File** › **Variables overview**), mark `message_rating_enabled` as Api editable too. Otherwise the variable never reaches the bubble and the thumbs follow only the bubble setting.
  {% endhint %}

## Rating earlier answers

The thumbs stay below every rateable answer for the whole conversation. A customer can scroll back and rate an earlier answer at any time – also after several more messages. The rating is saved to the answer it was given for, not to the latest one.

* Each answer can be rated once. The choice cannot be changed afterwards.
* New ratings are not possible after the conversation has ended or while the customer is chatting with a live operator.

## What is stored in Kibana

A rating is not stored as a separate record. Within a few seconds it is added to the **interaction log** of the rated answer (the `interaction-*` indexes in Kibana) – the same record that already holds the project, the node, the answer text and the conversation ID. Nothing is written to the technical logs.

| Field                                       | Content                                                                                                            |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `FeedbackCount`                             | How many parts of this answer were rated.                                                                          |
| `FeedbackLikeCount`, `FeedbackDislikeCount` | The number of thumbs up and thumbs down.                                                                           |
| `FeedbackRatings`                           | `like`, `dislike`, or both.                                                                                        |
| `FeedbackLastRatedAt`                       | When the customer last clicked a thumb.                                                                            |
| `Feedback`                                  | One entry per rated part: the rating, the rated text, the time of the click, the node, the channel and the bubble. |

Together with the fields of the interaction log – `ProjectName`, `NodeId`, `ConversationId`, the time of the answer, `ResponseText` (what the agent said) and `Utterance` (the customer's message the agent was answering; empty for the greeting) – this answers the usual questions: how satisfied customers are, which nodes collect the most thumbs down, and which question led to an answer the customer did not like.

To find the ratings in **Discover**, filter `FeedbackCount > 0`; for the negative ones, `FeedbackDislikeCount > 0`. Dashboards built on these fields can be opened from **Operate** › **Statistics**, see [Statistics](https://docs.borndigital.ai/digital-agent/advanced-functions/statistics.md).
