Agent Manager Bot
The LivePerson solution is based on the 3 major components: Conversation Builder bot manager, LivePerson Functions, and Conversation Context Service.
Conversation Builder bot, with Agent Manager permissions, will join every conversation in the queue. The bot reacts to every customer message and sends a message on behalf of the Agent if no other Agents are currently assigned to the conversation.
To check if there are no other Agents currently assigned to the conversation, the bot will send a request to the Conversation Context Service to get a pre-populated value. The Conversation Context should be pre-populated using the pre-created event-based function. The event that will be used to invoke a pre-created function is Messaging Participants Change. Messaging Participants Change is triggered every time the conversation is transferred to a different skill.
To check the wait time on the skill agent manager bot will send a request to the Conversation Context Service to get pre-populated value. The Conversation Context Service should be pre-populated using the pre-created function. The function will be triggered using the Scheduled Invocations. The interval for the scheduler can be defined separately, for example, every 5 min.
The source code for the function should have an API request to the Messaging Operations API. This API is based on the REST architecture style, which allows clients to send HTTP requests to view Conversational Cloud operational data. This API supports the HTTP GET functionality (data retrieval), and all data is returned in JSON format.
High-level architecture
The following details have been presented to the brand:
Enable controlled bot on the account.
- Using the LivePerson Functions need to create an event-based function that will be triggered by a Messaging Participants Change event.
- Messaging Participants Change event triggered on every participant (agent) change (joins/leaves) a messaging conversation.
- Function logic should store the state of the participant changes (joins/leaves) into Conversation Context Service by the ConversationID.
- This data will be leveraged in the bot by the logic described below.
- Using the LivePerson Functions need to create a no-event function that will be triggered by Scheduled Invocations.
- Develop the function logic that will call Messaging Operations API:
- Messaging Operations API - Messaging Current Queue Health
Property in response:
waitTimeForAgentAssignment_50thPercentile
(50% of the
conversations in the queue (unassigned) waited to be assigned for less time than this value).
Response example:
- Function logic should store the wait time into Conversation Context Service by the Skill ID.
- Implement Exponential retry based on the error code returned from API, considering the max execution time for the FaaS. Need to follow LivePerson Retry Policy Recommendations.
- Schedule Invocations should be configured to trigger the function every 5 minutes.
- This data will be leveraged in the bot by the logic described below.
- Create bot users with Agent Manager Permissions.
- Develop the function logic that will call Messaging Operations API:
- Messaging Operations API - Messaging Current Queue Health
Property in response:
waitTimeForAgentAssignment_50thPercentile
(50% of the
conversations in the queue (unassigned) waited to be assigned for less time than this value).
Response example:
javascript:
"skillsMetrics": {
"12": {
"time": 1516277646515,
"unassignedConversations": 34,
"actionableConversations": 10,
"notActionableConversations": 14,
"actionableAndManualSla": 7,
"actionableAndDuringTransfer": 6,
"actionableAndConsumerLastMessage": 3,
"notActionableDuringTransfer": 0,
"notActionableAndManualSla": 0,
"unassignedConversationsAndFirstTimeConsumer": 4,
"avgWaitTimeForAgentAssignment_NewConversation": 159,
"avgWaitTimeForAgentAssignment_AfterTransfer": 171,
"maxWaitTimeForAgentAssignment": 274,
"waitTimeForAgentAssignment_50thPercentile": 160,
"waitTimeForAgentAssignment_90thPercentile": 150,
"overdueConversationsInQueue": 0,
"overdueConversationsAssigned": 2,
"overdueConversationsTotal": 2
}
}
- Function logic should store the wait time into Conversation Context Service by the Skill ID.
- Implement Exponential retry based on the error code returned from API, considering the max execution time for the FaaS. Need to follow LivePerson Retry Policy Recommendations.
- Schedule Invocations should be configured to trigger the function every 5 minutes.
- This data will be leveraged in the bot by the logic described below.
- Create bot users with Agent Manager Permissions.
- The number of bot users should be based on account volume. Approximate 1 bot user per 999 conversations.
- Create a Conversation Builder bot Automation with the following logic:
- The bot should have a Dialog with a pattern to listen to all customer inputs.
- On
initConversation
global function the bot should get conversationID and currentSkillID store the values into the bot variables. - On every customer message the bot, using API Integrations, should send an API call to the Conversation Context Service to get the status of the conversation by ConverastionID.
- If there are no agents assigned to the conversation, the bot should send an API call to the Conversation Context Service to get the Wait Time by the Skill ID and send a message to the customer.
- If an agent is assigned to the conversation, the bot should send
BLANK_MESSAGE
. - The "Wait time" should be rounded and represented in minutes.
- The brand team should provide the exact sentence that will be sent to the customer.
- The brand team should provide the list of the skills whitelisted for the logic.
- The FaaS functions usage is free for the first 250k execution per month. Executions more than the limit will have an additional cost for the account.