10 Agent Integration

When your bot can’t handle a user request, the Agent Integration framework enables a handoff to a human agent, like a customer support rep (CSR) operating through Oracle Service Cloud. The handoff itself is seamless because human agents can see the bot user's chat history and can go from there. They can use this context to trigger the appropriate action on the user's behalf, or they can chat with the bot user first if they need to find out more. This interaction happens entirely on the same channel and within the same user session.

The Agent Integration Framework in Action

The bot asks the user if he needs help. By clicking yes, the bot connects to the Agent system and returns a Waiting for the agent message to the user. The CSR, monitoring an agent console, gets notified of the request and accepts it. The Agent Integration framework provides the user’s chat history. Using this, she can execute a Slash command (/OrderPizza) to execute the associated flow, or she can chat directly with the user. Once she executes the flow using the Slash command, the user-human agent interaction ends. The bot user can end the session with the agent anytime by entering closing words like bye or goodbye.

Integrate the Bot with a Human Agent

  1. Configure an agent service.

  2. Update the dialog using the System.AgentInitiation and System.AgentConversation components. The System.AgentInitiation component executes the hand off to the agent while System.AgentConversation conducts the user-agent interaction itself.

    You can find templates for these components by clicking User Interface in the Add Components dialog. To find out how to route to a user agent subflow, see Configure the Dialog Flow for User Agents.
    An image of the Agent intiation component in the Add Components menu.

Configure the Agent Integration

  1. Click Settings in the left navbar and then choose Agent Integration.

  2. Click Add Integration.

  3. Enter a name and optional description. Be sure that this name matches the agentChannel property value for both the System.AgentInitiation and System.AgentConversation components.

  4. Choose the agent system from the Integration Type menu.

  5. Define the remaining properties that are specific to the agent system.

  6. Switch on the Interaction Enabled toggle.

Configure the Dialog Flow for User Agents

You can use different methods to navigate to the user agent flow. As shown by the following snippet, you can create an intent for the user agent request that’s referenced as an actions property. The agent integration routing gets triggered when a user enters a distress call that the getAgent intent has been trained to understand, like help me please!
  intent:
    component: "System.Intent"
    properties:
      variable: "iResult"
      confidenceThreshold: 0.4
    transitions:
      actions:
        OrderPizza: "resolvesize"
        CancelPizza: "cancelorder"
        getAgent: "agentInitiation"
        unresolvedIntent: "unresolved"
You can also route to the user agent state with an unresolvedIntent action (unresolvedIntent: “agentInitiation”, for example). To do this:
  1. Configure the handshake with the agent system using the System.AgentInitiation.
      agentInitiation:
        component: "System.AgentInitiation"
        properties:
          agentChannel: "MyServiceCloudAgent"
          nlpResultVariable: "iResult"
          agentActions: "OrderPizza, CancelPizza"
          waitingMessage: "you joined the chat session"
          rejectedMessage: "Sorry we are not available now"
        transitions:
          actions:
            accepted: "agentConversation"
            rejected: "reject"
  2. Configure the System.AgentConversation. This snippet includes the supporting states, endprompt and reject.
      agentConversation:
        component: "System.AgentConversation"
        properties:
          agentChannel: "MyServiceCloudAgent"
          nlpResultVariable: "iResult"
          exitKeywords: "bye, adios, take care, goodbye"
          conclusionMessage: "have a nice day!"
        transitions:
          actions:
            OrderPizza: "resolvesize"
            CancelPizza: "cancelorder"
          next: "endPrompt"
      endPrompt:
        component: "System.Output"
        properties:
          text: "Returning you to your bot."
        transitions:
          return: "endPrompt"
      reject:
        component: "System.Output"
        properties:
          text: "We're busy. Try again later."
        transitions:
          return: "done"