-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
RFC: Flow Action – Encoding rules-based conversations in action-server #6178
Comments
Thanks for submitting this feature request 🚀 @tabergma will get back to you about it soon! ✨ |
We're working on creating |
One of the main problems that I see with your proposal is how to deal with user input that don't correspond to the flow |
Here is the PR for It doesn't contain documentation yet, but we added |
could you elaborate on what you mean by that? perhaps an example of where that fails? thanks! |
similar as forms. there could be an intent like some chitchat that is not handled by the deterministic flow |
that can be handled the same way it is handled within forms, no?
|
then I don't see the difference to a form, except that conditions of when to stop, and what to do are different. We added one more abstraction |
This can now. be achieved with the |
RFC: Flow Action – Encoding rules-based conversations in action-server
Problem
We (Dialogue) work with a large number of rules based conversations where we want certain blocks of the conversation to happen in a deterministic manner / same way 100% of the time. We also want to reuse these blocks across different Rasa stories.
We started out by leveraging what Rasa provides out of the box and ran into limitations with each:
1. Memoization Policy
This is meant for learning conversations that will happen the same way all the time – we use checkpoints in combination with actions that set featurized slots to achieve conditional branching to represent the rules in our rules based conversations.
Problems
We've reached the limits of how far we can go with this because of the sheer amount of training data, and subsequently, the time it takes to train, due to the high number of checkpoints and featurized slots.
This either means that our model fails to train given a fair amount of resources (Ubuntu, 16gb memory), and even if it does succeed, it takes over 15-20 minutes to train and build the app every time a change is made, making the feedback loops around testing conversational changes very slow, driving down engineering productivity.
There's probably a couple of specific problems to pull out from the above, we've created some issues around the problems we've run into thus far with what we know:
Beyond that, checkpoints are limited in their ability to compose rules based conversations, because two different Rasa stories cannot converge to a checkpoint and then each diverge to a different path from it – they both need to continue along the checkpoint.
2. Form Action
Next, we went down the route of expressing the rules based conversation as a single form – achieving any branching that we have to do by encapsulating that logic in the
required_slots
or therun
method of the form that are called on every turn.This approach led to the problems outlined below, but also made us realize that what we were trying to achieve is running a series of forms (or actions), each of which is triggered when a set of conditions were met.
Problems
With those constraints in mind, we set out to build an abstraction we'd like to have the Rasa team's thoughts on.
Flow action
Flow Action is like a Form action. It gets instantiated within a story as a form action would. It also requires a Form policy to be in place.
This is an action that executes a series of actions (actions, forms, or utterances) in a deterministic way. Each action specified as part of a Flow action can have a condition defined based on slot values that determines whether or not to execute the action.
We also built a YAML composer for Flow action to allow ease of writing and modifying conversational flows.
Example
How a Rasa story looks like using a flow
food_preference_flow
written as aFlowAction
:food_preference_assessment_flow
written as aFlowAction
:Illustration of alternative syntax for
condition
Notes
condition: food_preference_outcome is "burgers"
,food_preference_outcome
is a slotcondition
is a[pypred](https://github.com/armon/pypred)
Predicate
statement which is evaluted using slot values from the trackerResults
We've seen some positive preliminary results with this approach
condition
statements allow for combinations of boolean expressions.Questions for the Rasa team & community
As Rasa engineers, is this a reasonable extension of Rasa, what problems do you forsee?
Authored by Ed and myself
The text was updated successfully, but these errors were encountered: