Guideline Relationships
Guideline Relationships
Defining how guidelines relate to each other is a powerful (and advanced) part of Conversation Modeling. While these relationships might sound complex at first, they give you a ton of power as a modeler, making you much more capable of generating precise outcomes.
At the very least, we recommend reviewing these relationships briefly to understand their purpose.
Relationship Types
At a glance, these are the supported relationships. Each relationship is between a source (notated S) and a target (notated T). Click on a relationship type to learn more about it.
- Entailment: When S is activated, T should always be activated
- Implication*: When S is activated and T hasn't applied yet, T should be activated
- Priority: When both S and T are activated, only S should be activated
- Requirement*: When T is activated, S should be activated and completed before T is activated
- Persistence*: When S is activated, T should never activate in the same session from that point on
* Marked relationships are scheduled to be added in Parlant 2.1.
Entailment
When S is activated, T should always be activated
To understand the need for entailment, we first need to understand how Parlant chooses which guidelines activate for an agent when it's about to say something to the customer.
Basically, Parlant examines the session at its current state, and asks questions about it: "Is this guideline relevant now?", "Is that guideline relevant now?".
To do this, it primarily tests the guidelines' conditions.
This would seemingly work well by itself, until you consider two guidelines of the following form:
- Guideline A: When X, Then Y
- Guideline B: When Y, Then Z
Now imagine a situation where, looking at a session, we determine that X does in fact apply, but Y doesn't. With the naive logic above, we would have only fed the agent with the guideline to do Y.
But when we step back and analyze this case, we know that the agent is just about to do Y, which means that, according to the guidelines we have installed, Z should also apply.
That is what entailment accomplishes: requiring that whenever A is activated, B is also activated.
Implication
When S is activated and T hasn't applied yet, T should be activated
This feature is scheduled to be added for Parlant 2.1. Check back soon!
Whereas Entailment always activates B when A is activated, Implication is a slightly weaker bond that gets B to activate only if its action is not deemed to have already been accomplished in the session.
Priority
When both S and T are activated, only S should be activated
Priority can be used for multiple use cases. The two most common ones are:
- Controlling the flow and precedence of actions within the conversation
- Disambiguating user input
Controlling Precedence
You may have two guidelines that happen to be activated at the same time, such as:
- When the customer wants to make a transaction, Then help them complete the transaction
- When the customer has less than $1,000 in their account, Then offer savings plans
You may find that the guidelines above activate simultaneously when, for example, account balance details are introduced into the session while the user is in the process of submitting a transaction.
To ensure that savings plans are offered—but with good timing, only once the transaction is completed—you can prioritize completing the transaction over offering savings plans. Once the transaction is completed, the savings-related guideline may be activated.
Disambiguating User Input
You may have a situation where between two (or more) competing guidelines where some or all of which are activated at the same time due to ambiguity, leading to instruction following confusions.
For example, if a customer sent the message "What are my limits?" to a banking agent, and you had the following guidelines, each of which was optimistically activated according to the engine's interpretation:
- When the customer is inquiring about their ATM limits, fetch the data from their account profile
- When the customer is inquiring about their credit card's limits, fetch them from the card provider
To clarify the customer's intent, you could add an additional guideline, prioritized over all of the above:
When the customer is inquiring about limits but it isn't clear if they're talking about ATM limits, credit card limits, or some other types of limits, Then ask them to clarify what kind they mean
Requirement
When T is activated, S should be activated and completed before T is activated
This feature is scheduled to be added in Parlant 2.1. Check back soon!
Persistence
When S is activated, T should never activate in the same session from that point on
This feature is scheduled to be added in Parlant 2.1. Check back soon!