Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ATO 1080] create product documentation for markers #12527

Merged
merged 32 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c08b9b1
add documentation for realtime-markers
vcidst Jun 19, 2023
e0775e5
add changelog
vcidst Jun 19, 2023
859d1a8
add data structure reference to marker tables
vcidst Jun 19, 2023
d2607f4
Merge branch '3.6.x' into ATO-1080-Create-product-documentation-for-m…
vcidst Jun 19, 2023
75fac49
resolve review comments
vcidst Jun 20, 2023
18b0469
update command description
vcidst Jun 20, 2023
03b7250
add a deprecation banner
vcidst Jun 20, 2023
8bd7dc2
add rasa-pro-label
vcidst Jun 20, 2023
5e73d1a
Merge branch '3.6.x' into ATO-1080-Create-product-documentation-for-m…
vcidst Jun 26, 2023
2569527
add realtime markers graphic
vcidst Jun 27, 2023
662c33a
Merge branch 'ATO-1080-Create-product-documentation-for-markers' of g…
vcidst Jun 27, 2023
7e1035a
Merge branch '3.6.x' into ATO-1080-Create-product-documentation-for-m…
vcidst Jun 27, 2023
0c3e781
Update rasa-pro.mdx
andreaklmn Jun 28, 2023
bd7d6b2
Update docs/docs/monitoring/analytics/realtime-markers.mdx
vcidst Jul 1, 2023
c331aef
Update docs/docs/command-line-interface.mdx
vcidst Jul 1, 2023
88ded25
Update docs/docs/markers.mdx
vcidst Jul 1, 2023
8385571
Update docs/docs/monitoring/analytics/realtime-markers.mdx
vcidst Jul 1, 2023
b5a0fab
Update docs/docs/monitoring/analytics/realtime-markers.mdx
vcidst Jul 1, 2023
0789173
Update docs/docs/monitoring/analytics/realtime-markers.mdx
vcidst Jul 1, 2023
fb32a4e
Update docs/docs/monitoring/analytics/realtime-markers.mdx
vcidst Jul 1, 2023
23b8b2c
Update docs/docs/monitoring/analytics/realtime-markers.mdx
vcidst Jul 1, 2023
ce70b0d
Update docs/docs/markers.mdx
vcidst Jul 1, 2023
61f6052
rephrase sentence in rasa_marker
vcidst Jul 1, 2023
bddcf53
Merge branch 'ATO-1080-Create-product-documentation-for-markers' of g…
vcidst Jul 1, 2023
f253589
rephrased to remove the term "marker definition"
vcidst Jul 2, 2023
506c1ff
Merge branch '3.6.x' into ATO-1080-Create-product-documentation-for-m…
vcidst Jul 2, 2023
69c590f
Merge branch '3.6.x' into andreaklmn-docs-change
m-vdb Jul 3, 2023
81048b7
Add link to PII docs
m-vdb Jul 3, 2023
f9debbc
Fix link format
m-vdb Jul 3, 2023
bd73bd6
Add link to markers docs
m-vdb Jul 3, 2023
b0523f0
Merge pull request #12578 from RasaHQ/andreaklmn-docs-change
m-vdb Jul 3, 2023
3a056ec
Merge branch '3.6.x' into ATO-1080-Create-product-documentation-for-m…
vcidst Jul 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/12527.doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added Documentation for Realtime Markers Section.
63 changes: 63 additions & 0 deletions docs/docs/command-line-interface.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import RasaProBanner from "@theme/RasaProBanner";
|`rasa data validate` |Checks the domain, NLU and conversation data for inconsistencies. |
|`rasa export` |Exports conversations from a tracker store to an event broker. |
|`rasa evaluate markers` |Extracts markers from an existing tracker store. |
|`rasa marker upload` |Upload marker configurations to Analytics Data Pipeline |
|`rasa license` |Display licensing information. |
|`rasa -h` |Shows all available commands. |

Expand Down Expand Up @@ -661,6 +662,68 @@ Python Logging Options:
--quiet Be quiet! Sets logging level to WARNING. (default: None)
```

## rasa markers upload

vcidst marked this conversation as resolved.
Show resolved Hide resolved
<RasaProLabel />

<RasaProBanner />

:::info New in 3.6

This command is available from Rasa Pro 3.6.0 and requires [Rasa Analytics Data Pipeline](./monitoring/analytics/getting-started-with-analytics.mdx)
:::

This command applies to [markers](./markers.mdx) and their [real-time processing](./monitoring/analytics/realtime-markers.mdx).
Running this command validates the marker configuration file against the domain file and uploads the configuration to Analytics Data Pipeline

```
usage: rasa markers upload [-h] [-v] [-vv] [--quiet]
[--logging-config-file LOGGING_CONFIG_FILE]
[--config CONFIG]
[--rasa-pro-services-url RASA_PRO_SERVICES_URL]
[-d DOMAIN]

optional arguments:
-h, --help show this help message and exit
--config CONFIG The marker configuration file(s) containing marker
definitions. This can be a single YAML file, or a
directory that contains several files with marker
definitions in it. The content of these files will be
read and merged together. (default: markers.yml)
--rasa-pro-services-url RASA_PRO_SERVICES_URL
The URL of the Rasa Pro Services instance to upload
markers to.Specified URL should not contain a trailing
slash. (default: )
-d DOMAIN, --domain DOMAIN
Domain specification. This can be a single YAML file,
or a directory that contains several files with domain
specifications in it. The content of these files will
be read and merged together. (default: domain.yml)

Python Logging Options:
You can control level of log messages printed. In addition to these
arguments, a more fine grained configuration can be achieved with
environment variables. See online documentation for more info.

-v, --verbose Be verbose. Sets logging level to INFO. (default:
None)
-vv, --debug Print lots of debugging statements. Sets logging level
to DEBUG. (default: None)
--quiet Be quiet! Sets logging level to WARNING. (default:
None)
--logging-config-file LOGGING_CONFIG_FILE
If set, the name of the logging configuration file
will be set to the given name. (default: None)

Description:
The `rasa markers upload` command allows you to upload Markers to the Rasa Pro Services. Markers are custom conversational events that provide additional context for analysis and insights generation. By uploading Markers, you can enable real-time analysis and enhance the performance of your Rasa Assistant.
vcidst marked this conversation as resolved.
Show resolved Hide resolved

Examples:
Upload Markers to Rasa Pro Services:
rasa markers upload --config markers.yml --rasa-pro-services-url https://example.com/rasa-pro -d domain.yml

```

## rasa license

<RasaProLabel />
Expand Down
12 changes: 12 additions & 0 deletions docs/docs/markers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ This feature is currently experimental and might change or be removed in the fut

:::

:::danger

In the upcoming release version 3.7 of Rasa Open Source, we’re removing this experimental feature. For documentation on the Markers feature in Rasa Pro, please [click here](./monitoring/analytics/realtime-markers.mdx)
vcidst marked this conversation as resolved.
Show resolved Hide resolved

:::

## Overview

Markers are conditions that allow you to describe and mark points of interest in dialogues for evaluating your bot.
Expand Down Expand Up @@ -173,6 +179,12 @@ You cannot reuse an existing marker name in the definition of another marker.

## Extracting Markers

:::info

Rasa Pro supports real-time processing of Markers, Read more about [Real-Time Markers](monitoring/analytics/realtime-markers.mdx)
vcidst marked this conversation as resolved.
Show resolved Hide resolved

:::

Markers are extracted from dialogues already stored in a tracker store. To learn how to store interactions with your bot in a tracker store,
read the [Tracker Store](./tracker-stores.mdx) page.

Expand Down
114 changes: 114 additions & 0 deletions docs/docs/monitoring/analytics/data-structure-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,120 @@ Time of the last update of the slot in this session. The timestamp is a UTC.
- Type: `DateTime`
- Example: `2022-06-21 02:15:49.326936`

### rasa_patterns

Patterns are marker definitions that have been received from Rasa. This table is called `patterns`
to distinguish them from extracted markers which are stored in `rasa_markers` table. It
stores the configuration of markers (which can be thought of as a pattern
of conversational events) along with their metadata.

#### `id` pattern identifier

The unique identifier of the rasa pattern is generated by Analytics.

- Type: `varchar(36)`
- Example: `bd074dc7-e745-4db6-86d0-75b0af7bc067`

#### `name` pattern name

Name of the pattern

- Type: `varchar()`
- Example: `registration success`

#### `description` pattern description

Description of the pattern

- Type: `varchar()`
- Example: `This marker identifies successful account registration in the chat`

#### `config` pattern configuration

Pattern configuration dictionary stored as an escaped string

- Type: `varchar()`
- Example: `"{'or': [{'intent': 'mood_unhappy'},{'intent': 'mood_great'}]}"`

#### `is_active` soft-delete flag

Only patterns with `is_active==True` are processed during real-time analysis

- Type: `boolean`

#### `created_at` creation date time

Time of creation of this pattern. The timestamp is a UTC.

- Type: `DateTime`
- Example: `2022-06-21 02:15:49.326936`

#### `updated_at` update date time

Time of the last update of the pattern in this session. The timestamp is a UTC.

- Type: `DateTime`
- Example: `2022-06-21 02:15:49.326936`

### rasa_markers

Markers are the extracted markers from the conversations. Each row in this table corresponds
vcidst marked this conversation as resolved.
Show resolved Hide resolved
to a marker along with details of the pattern, sender, session and the event

#### `id` marker identifier

The unique identifier of the extracted rasa marker is generated by Analytics.

- Type: `varchar(36)`
- Example: `bd074dc7-e745-4db6-86d0-75b0af7bc067`

#### `pattern_id` pattern which was applied in this marker

The unique identifier of the pattern which was applied in this marker. It is
a foreign key to the [`rasa_patterns.id`](#rasa_patterns) column

- Type: `varchar(36)`
- Example: `9e4ebded-f232-4cc5-af78-d98daa0c1a53`

#### `sender_id` sender identifier

The unique identifier of the sender whose conversation this marker is part of.
It is a foreign key to the [`rasa_sender.id`](#rasa_sender) column.

- Type: `varchar(36)`
- Example: `9e4ebded-f232-4cc5-af78-d98daa0c1a53`

#### `session_id` session identifier

The unique identifier of the session this marker is part of.
It is a foreign key to the [`rasa_session.id`](#rasa_session) column.

- Type: `varchar(36)`
- Example: `63b150a6-21a3-4e6c-bb24-5ab6ddc30cf1`

#### `event_id` event identifier

The unique identifier of the event from event broker where this marker was applied.
Note that a marker can be applied across multiple events, this is the ID of the last event in the sequence.

- Type: `varchar(36)`
- Example: `63b150a6-21a3-4e6c-bb24-5ab6ddc30cf1`

#### `num_preceding_user_turns` Number of Proeeding User turns

an integer indicating the number of user turns preceding the event at which the marker applied.

- Type: `integer`
- Example: `4`

#### `created_at` creation date time

Time of creation of this marker. The timestamp is a UTC.

- Type: `DateTime`
- Example: `2022-06-21 02:15:49.326936`


## Internal Tables

Internal tables are used to store information about the assistant and
Expand Down
87 changes: 87 additions & 0 deletions docs/docs/monitoring/analytics/realtime-markers.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
id: realtime-markers
sidebar_label: Real-Time Markers
title: Real-Time Analysis of Markers
description:
abstract: Process Markers real-time from Rasa
vcidst marked this conversation as resolved.
Show resolved Hide resolved
Assistants to track metrics like solution and abandonment rates,
add metatags to conversations,
or filter conversations for Conversation Driven Development
---

import useBaseUrl from "@docusaurus/useBaseUrl";
import RasaProLabel from "@theme/RasaProLabel";
import RasaProBanner from "@theme/RasaProBanner";
import { Grid } from "@theme/Grid";

<RasaProLabel />

:::info Available in Rasa Pro from 3.6.0
:::

<RasaProBanner />

In Rasa Pro, [Markers](../../markers.mdx) is a powerful feature that allows
you to track and extract custom conversational events. With the Analytics
Data Pipeline, you can now process these Markers in real-time, enabling
vcidst marked this conversation as resolved.
Show resolved Hide resolved
you to gain valuable insights and enhance the performance of your Rasa
Assistant. In this guide, we'll explore how to leverage real-time
analysis of Markers to track solution rate and abandonment in your conversations.

## Defining Markers

Please consult the [Markers](../../markers.mdx/#defining-markers) section of Rasa documentation
for details about defining Markers.
vcidst marked this conversation as resolved.
Show resolved Hide resolved

## Enable Real-time Processing

To enable real-time analysis of Markers in your Rasa project, you need to
vcidst marked this conversation as resolved.
Show resolved Hide resolved
upload the markers to Analytics Data Pipeline with the `rasa markers upload`
command. This command uploads the marker configuration YAML and starts the
processing of Markers in the Analytics Data Pipeline. To get started,
make sure you have the latest version of Rasa installed. Then, open your command line
vcidst marked this conversation as resolved.
Show resolved Hide resolved
interface and navigate to your Rasa project directory. Run the following command:

```
rasa markers upload --config=<path-to-config-file> -d=<path-to-domain-file> -rasa-pro-services-url=<url>
```

By default, this command validates the marker configuration file against
your bot's domain.yml file. To specify a different domain file, use the
optional `-d` argument.

This command should be run whenever there is a change in the marker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you stop forwarding real-time markers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry I didn't understand your question. Did you mean to ask how does one stop uploading the marker-configurations to rasa-pro-services? The marker-configurations are only forwarded to rasa-pro-services (referred as Analytics Data Pipeline in the documentation) when this command is run.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the impression that this command starts "real time processing" of markers and that it kicks off real-time forwarding of markers to the analytics pipeline by Rasa.

I must be confused about what happens when you run this command.

Does the command do a one time upload of markers to the analytics and then exit? Does it run and forward markers until you manually stop the command?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command uploads the marker-configuration(aka patterns) files and then exits. Rasa Analytics stores these patterns in a database table called rasa_patterns. To remove any pattern, you can remove them from the YAML file and run rasa markers upload again.

Rasa Analytics will then process all events from Kafka and extract any markers that it founds in the stream of events. The markers are extracted based on the patterns in rasa_patterns table. Extracted markers are stored in rasa_markers table

configuration file. The changes might include addition of new markers,
changing an existing marker or removing an existing marker.

:::note

This command **uploads** the marker configurations to the data pipeline. The pipeline assumes the configuration
file is the source of truth and only processes the markers defined in it. If you remove a marker from this file,
and run this command, then the processing for that marker is stopped.

:::

### Configuring the CLI command

Visit our [CLI page](./command-line-interface.mdx#rasa-marker-upload)
for more information about the command line arguments available.

## How are Markers processed?

Once the marker definitions are uploaded to the Analytics Data Pipeline, they
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's a "marker definition"? Above, it says "This command uploads the marker configurations to the data pipeline." and here it's talking about the "marker definitions are uploaded"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that's a bit confusing. Marker definition or marker configuration refers here to the YAML files that describe the marker in the following manner,

marker_cheer_up_success:
  description: "Sequence of intent and action that define the marker_cheer_up_success"
  seq:
    - intent: mood_unhappy
    - action: utter_cheer_up
    - action: utter_did_that_help
    - intent: affirm

This information is used to identify when these event sequences occur in the conversation. Or, when marker_cheer_up_success is extracted from a conversation. To differentiate these, I have referred the YAML files as "marker-configuration" and the markers found in the conversations as "extracted markers".

Do you have any suggestions for making this distinction more clear and simplified?

are stored in the `rasa_patterns` table. As the Kafka Consumer starts receiving events
from the Rasa Assistant, it starts analyzing them for markers. The Pipeline
processes all the events from the Kafka Event Broker and identifies points of
interests in the conversation that matches the marker. The extracted markers are stored
in the data warehouse.

The evaluation of Markers in the Pipeline is similar to the `rasa evaluate markers`
command which can be used to process markers from the conversations in Tracker Store.
vcidst marked this conversation as resolved.
Show resolved Hide resolved
Read more about it [here](../../markers.mdx/#extracting-markers)

Extracted markers are added to the `rasa_markers` table in the data warehouse
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an example query and graph for markers on the Example queries page?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add an example query and graph to visualise num_preceeding_user_turns for a marker that tracks when user has completed the form. It'll visualise the number of turns users took to complete the form and can help give insight if the users are struggling to complete the form. Will something like that be helpful? It's only one of the many use cases of this feature

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A form related example would be really good. When Alana and I recently wrote the blog post on this subject, we really needed a completion rate example. For a given form or story, how many people started the form and how many completed it successfully.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a given form or story, how many people started the form and how many completed it successfully.

I'll add this example to this documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rgstephens With a release schedule of next week, we're short on time to add this example at the moment but I've created a ticket at https://rasahq.atlassian.net/browse/ATO-1227 for this and we'll add this example in a micro release

immediately once they are processed. There might also be instances where
a marker is applied several times in a conversation. Check out the
[Data Structure Reference](data-structure-reference.mdx/#rasa-markers) page for the
database schema of relevant tables.
1 change: 1 addition & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ module.exports = {
collapsed: true,
items: [
'monitoring/analytics/getting-started-with-analytics',
'monitoring/analytics/realtime-markers',
'monitoring/analytics/example-queries',
'monitoring/analytics/data-structure-reference',
],
Expand Down