Lesson 2
Advanced Pathway Features
Beyond prompting and basic decision trees, Pathways are packed full of features to allow you to control conversation flow more precisely, and integrate with the outside world.
LEARNING OBJECTIVES
Advanced Flow Control (conditionals)
Press buttons
Global nodes
Live testing and fine-tuning functions
Custom tools
SMS
Advanced Flow Control With Conditionals
When you split a node with multiple pathways, naturally the Bland Agent will need to make a decision on which path is best. This is where conditionals are used..
Pathway Labels
Labels are the simplest way to express a condition. Prompts like “User says yes” work here. Don’t worry if this seems too vague for your workflows, you’ll be able to add more context to the condition in the description.
Pathway Descriptions
Descriptions provide more detailed context to the labels. Verbose 1-shot phrasing like: “Select THIS PATHWAY IF [ written out condition]” are extremely effective as descriptions.
Advanced Variable Comparisons
If you have extracted variables from a previous node, you can create conditionals based on their values to proceed in the Pathway. Boolean logic and keyword matching are used for this feature.
Loop Conditions in Nodes
You can also prompt your Agent to stay within a specific node until a specified condition is met. These conditions prompts as well.
Global Nodes Advanced Functionality
Global nodes are a way to create a node, that is (behind the scenes) connected to every other node in your Pathway. This is especially useful for pattern interrupts or ‘short-circuits’ in your Pathway. For example one of the most common Global Nodes is a ‘Transfer to a Live Agent’ type node.
In one of our real world examples, we’ll use a Global node to transfer the prospect to a live sales team if they indicate their interest to buy something at any point during the call.
Global Nodes – Automatic Return
Global nodes are capable of automatically returning to a previous node after executing their instructions. This can be a great way to control flow of your Pathways by handling edge cases in a global node. After the dialogue from this node is generated, automatically go back to the previous node that triggered this global node. Toggling this off will unlock the circle at the bottom of the node, allowing you to create pathway labels from this node to other nodes, as well as the previous node it came from.)
Global Nodes – Create Label and Pathway to Previous Node
Sometimes you want the ability to return back to your Pathway from the global node. This will allow you to create a pathway label from this node to the previous node that triggered this global node.
Global Nodes – Redirect to Another Node
If you don't’ want your agent to process on dialog or prompts, set your global node to redirect somewhere else. This will ignore any prompts set within the node, and automatically move your conversation to the next specified node.
Node Conditions
Advanced Options
In the Node configuration expander, you will find a few more options for flow control. Interruptions are part of any live phone conversation, and it’s up to you to instruct your Agent how exactly they should be handling them.
Dynamic Interruption Threshold
Update interruption threshold from this node onwards. This will help in reducing interruptions at specific points of the conversation.
Skip User's Response
Toggle this option if you want the Agent to continue from this node without waiting for the user's response. The next node will be selected based on the previous dialog.
Block Interruptions
Toggle this option if you want the Agent to ignore user's interruptions at this node. The Agent will talk over the user and finish it’s sentence.
Live Call Logs
Live call logs are a way to provide you with a live feed of the conversation between the agent and the user. This is useful for debugging purposes and gives you more insight into your Agent’s decisions. On top of the transcript, we expose the updated node the agent took, the pathway that the agent took, as well as whether the condition was met or not.
Call Log Contents
There are three types of logs that are written in your call logs:
USER Speech (word for word translation of what the user called has said.
ASSISTANT Speech (what our Agent is saying)
PATHWAY Infos (the backend information about what Node we are on, and what’s happening with it)
Call logs are written to the screen in [Label] : Text format.
Current Node: [some text]
This label tells you which node the Agent is processing.
Current Node Prompt: [ your prompt text]
An exact copy of the prompt or text you have configured for the node that is running.
Condition Achieved
Every node has some condition defined either by your prompt or specific conditions configured. The Agent will decide at these points whether they have met the condition, and then decide what to do next.
Chosen Pathway
This is where the agent will head next. This information is very useful for debugging agents with complex instructions. Once you see a deviation of pathway in the log, it’s easy to determine if the issue originated with the prompt, a conditional, or with the agent’s comprehension of the user’s speech.
Testing the Pathway Agent via Chat
You can test the responses from your Agent by clicking on the “Chat with Pathway” button at the top right of the screen. This will open a chat window where you can test the agent by sending it messages. The live call logs will also be displayed on the right side of the screen, so you can see the decisions the agent is making in real-time.
Inputs to Chat Testing
You are able to specify which node the chat should begin with. If you have complex trees or the agent requires access to previous context. Best practice is to start at the beginning node. You also are able to pass in variables, similar to how you might when initiating the call via an API request.
How to Chat With Your Agent
Once you have initiated the test, you will see two windows. The left window is your actual “chat” interface, where you will speak to your Agent as if it were a regular conversation. The right window is your call log.
Be Conversational
Try to type your messages to the agent like how a real potential user would speak (avoid the shorthand you might use on a chatbot) to get the best testing results.
Watch the Real Time Logs
Keep an eye on the logs to verify that your prompts are being understood properly. Accidental misconfiguration of nodes is the most common reason why Agents derail from their intended paths.
Variables Reference/Extraction
You can reference variables in pathways using double curly braces like {{first_name}}. You can pass variables into your call by passing in the key-value pairs in the request_data field when sending a call.
Some examples of variables that you can access at each node:
{{lastUserMessage}} - The last response from the user
{{prevNodePrompt}} - The prompt from the previous node
{{now_utc}} - The current time in UTC
{{from}} - The phone number the call is from
{{to}} - The phone number the call is to
{{call_id}} - The unique identifier for the call
Extracting Variables from Call/User Response
At each node, you can also extract variables from the user’s response using the Extract Variables from Call Info field. You would put in the name of the variable you want to extract, the type of the variable (integer, string, boolean), and the description for what information you want the variable to store. You can also provide specific formats and examples in the description. The better the description, the better the agent will be at extracting the variable more accurately.
Note: When you have extracted a variable, and reference in future nodes in your pathway, slight latency will be introduced to your Agent’s responses. This is because to access that variable the Agent would have to re-extract it.
Within the webhook node, the variable extraction happens before the webhook is executed.
You can reference the variables extracted from the user’s response in the webhook’s request data. The variables extracted from the webhook in response_data can also be referenced in the dialogue generated after the webhook is executed, in the same manner.
For Example, the image below shows how the Webhook Node is set up to extract the date, time, and number of guests for the reservation, and how the extracted variables are referenced in the webhook’s request data.
Fine Tuning the Pathway Agent
While Conversational Pathways gives you greater control compared to the regular call Agent, it may still make incorrect decisions or create unexpected output.
However, we have provided you with the tools to handle these issues if they arise. Each node can be fine-tuned on the decision it makes, as well as the expected dialogue it generates, allowing you to handle even the most extreme edge cases that might arise easily.
If you see a decision that the agent made that you do not agree with, or if the agent is generating unexpected output, you can fine-tune the decision the agent makes by clicking on the Edit button on the PATHWAY DECISION INFO block.