Rules are conditional statements based on action outputs. They ensure the correct steps are taken before invoking the LLM, regardless of behaviors or actions built into other Guide sections. Think of authoring rules as a means to limit the the ways Sidekick may interpret guidance within a given section. If there is a particular element of a workflow that must be completed in a specific manner, build a rule to ensure Sidekick always executes this step exactly as configured.
Consider the following examples of when to author a rule:
Guide Type | Step Requiring a Rule | Sample Rule Statement *Bolded phrases indicate the portion of the statement built as a rule |
---|---|---|
Order Status | Sidekick cannot find an order associated with the order number provided by the Customer. | If no order is found, then let the customer know you couldn't find an order using the order number they provided and give them a list of recent orders from the past month to select from. |
Cancel Order | Only orders with an “Unfulfilled” status are eligible for cancellation. | If the order status is unfulfilled, then provide the customer with specific order details and confirm that they would like to proceed with cancellation. If the order status is fulfilled, inform the customer that their order is no longer eligible for cancellation and provide the steps they can take to return the item for a refund. |
Return Order | Sidekick must be able to accurately look up the Customer’s profile in order to begin the return process. | If there are multiple customer profiles, then handoff to an agent. |
Before you start
Understand the basic flow a Guide follows when addressing rules.
Rules require access to external information in order to evaluate
An action must be added to any section that includes rules.
The action associated with the section runs.
Rules added to the section are evaluated in the order they are added.
If a rule evaluates to true, it’s executed as configured (i.e. completes the corresponding activity, goes to the instructed next section, initiates a handoff to an agent, etc).
If no rules evaluate to true, the Guide proceeds with the rest of the non-rule based guidance in the section.
Best practices for writing rules
Rule order matters
Because rules are evaluated sequentially, a Guide will execute the first rule that evaluates to true. Rules added after the first rule to execute are skipped.
Rules are assessed before guidance
Given the flow Guides follow when addressing rules, additional guidance added to the section is not taken into consideration when Sidekick executes a rule.
Example – a section may include the following:
Rule: If there are no orders, then the customer's inquiry didn't return any matching orders. Suggest they try another email or share their order number directly.
Guidance: Keep the tone consistently friendly and welcoming.
In this example, Sidekick will execute the rule first, and if it evaluates to true (i.e. after running the action, no orders are found) Sidekick will respond to the customer before addressing the guidance. If there is a specific piece of guidance that is important to consider as part of the rule execution, add it to the rule statement itself.
Add a rule to a section
Select the Guide within which you would like to add a rule.
Identify or add the section to input a rule.
Click into the section and write the rule statement.
Highlight the portion of the statement to configure as a rule and select the lightening bolt.
Example – for the rule statement “If the order status is fulfilled, inform the customer that their order is no longer eligible for cancellation,” highlight the order status is fulfilled to configure the necessary conditions.
An action must be selected in order to build rules
The lightening bolt icon used to configure rules is only present when an action has been added to the section.
Configure conditions in the rule builder.
Click Done.
Click Save.