ユーザーガイド: 人間のエージェント向けのスーパーバイザー アシスト

人間のエージェント向けのスーパーバイザー アシストを使用すると、人間のスーパーバイザーはエンドユーザーと人間のエージェント間の会話をモニタリングできます。会話を人間のスーパーバイザーにエスカレーションするタイミングに関するルールを定義します。会話がルールに一致すると、スーパーバイザー アシストが自動的に人間のスーパーバイザーにアラートを送信します。

会話の各エンドユーザー ターンについて、感情スコアと文字起こしが表示されます。ルールでは、これらの感情スコアまたは AI コーチを使用して、人間の監督者にアラートが送信されるタイミングを判断できます。

始める前に

スーパーバイザー アシストを使用するには、エージェント アシストの会話プロファイルと次の Identity and Access Management(IAM)ロールが必要です。

  • dialogflow.virtualAgentMonitoringSupervisor
  • dialogflow.processor

ステップ 1: 会話プロファイルを構成する

会話プロファイルでは、会話中にエージェントに提示される候補を制御する一連のパラメータを構成します。次の手順では、HumanAgentAssistantConfig オブジェクトを使用して ConversationProfile を作成します。API を直接呼び出したくない場合は、Agent Assist コンソールを使用してこれらの操作を行うこともできます。

会話プロファイルを作成する

会話プロファイルを作成するには、ConversationProfile リソースの create メソッドを呼び出します。ナレッジベース ID、ドキュメント ID、プロジェクト ID、モデル ID を指定します。レスポンスには、新しい会話プロフィール ID が含まれます。

JSON の例を次に示します。

{
  "displayName": "smart_compose_assist",
  "humanAgentAssistantConfig": {
    "humanAgentSuggestionConfig": {
      "featureConfigs": [
        {
          "suggestionFeature": {
            "type": "SMART_COMPOSE"
          },
          "queryConfig": {
            "documentQuerySource": {
              "documents": "projects/project-id/knowledgeBases/knowledge-base-id/documents/document-id"
            },
           "maxResults": "1"
          },
         "conversationModelConfig": {
           "model": "projects/project-id/conversationModels/model-id"
         }
        }
      ]
    }
  }
}

ステップ 2: 感情分析または AI コーチを選択する

会話のモニタリングに感情分析、AI コーチ、またはその両方を使用するかどうかを選択します。エスカレーション ルールにもこの選択が反映されます。

センチメント

会話全体を通してエンドユーザーの感情を分析するには、会話プロファイルに感情分析を追加します。

AI コーチ

AI コーチを使用して会話を分析するには、手順に沿って AI コーチ ジェネレータを作成します。1 つの会話プロファイルに対して一度に作成できる AI コーチ ジェネレータは 1 つのみです。AI コーチ ジェネレータには無制限の数の指示を追加できます。各指示には、少なくとも表示タイトル条件を含める必要があります。

ジェネレータを作成したら、新しいジェネレータ ID をコピーして会話プロファイルに追加します。

ステップ 3: 会話をモニタリングするルールを設定する

会話プロファイルを更新して、感情分析または AI コーチを使用するカスタマー サポートの会話のモニタリング ルールを有効にして構成します。次のいずれかのオプションを選択して、API で会話プロファイルを更新します。

  • ConversationProfile リソースで update メソッドを呼び出します。
  • UpdateConversationProfile メソッドを使用して、インタラクション モニタリング構成を設定します。インタラクション モニタリング構成を設定するリクエストは、次の例のようになります。

    conversation_profile {
      name: "projects/agent-assist-console-demo/locations/global/conversationProfiles/your_new_conv_profile_id"
      interaction_monitoring_config {
        event_notification_config = {
        notification_config = { # If you want to enable notifications on your custom pub/sub topic, add it here.
        topic = 'ADD_YOUR_CUSTOM_PUBSUB_TOPIC'
            message_format = 'JSON'
          }
      # Optional: Leave both empty for *Default Mode*.
      # Other supported configurations:
      # 1. **Default Mode:** Always publish alert events when they are triggered and publish metric events only when an alert is triggered,
      #   - Metric event: `METRIC_EVENT_PUBLISH_IF_ALERT_TRIGGERED`
      #   - Alert event: `ALERT_EVENT_ALWAYS_PUBLISH`
      # 2. **Pure Monitoring Mode:** Publish all metric events, but never publish alert events.
      #   - Metric event: `METRIC_EVENT_ALWAYS_PUBLISH`
      #   - Alert event: `ALERT_EVENT_NEVER_PUBLISH`
      # 3. **Publish All Events:** Always publish both metric and alert     events.
      #   - Metric event: `METRIC_EVENT_ALWAYS_PUBLISH`
      #   - Alert event: `ALERT_EVENT_ALWAYS_PUBLISH`
      # Note: Avoid setting `metric_event_notification_mode` to `METRIC_EVENT_PUBLISH_IF_ALERT_TRIGGERED` while `alert_event_notification_mode` is `ALERT_EVENT_NEVER_PUBLISH`, as this combination will result in no events being published.
    metric_event_notification_mode = 'ADD'
    alert_event_notification_mode = 'ADD'
        }
        alerting_config {
          # Required.
          rules {
            alert_rule_id: "rule_1"
            description: "rule_1_description"
            trigger_condition {
            ...
            }
      rules {
            alert_rule_id: "rule_2"
            description: "rule_2_description"
            trigger_condition {
            ...
            }
          }
          # Optional Tool config to retrieve customer name. If not    required, skip setting the metadata_config
          metadata_config = {
            tool_configs = [
        {
          display_name = 'Customer Name'
          toolset_tool = {
            toolset = 'ADD_CUSTOM_TOOLSET'
            operation_id = 'load_profile'
          }
          response_key_path = 'sessionInfo.customerProfile.customerName'
        },
            ]
          }
    
        }
      }
    }
    update_mask {
      paths: "interaction_monitoring_config"
    }
    }

サポートが必要な場合は、 Google Cloud 担当者にお問い合わせください。

構成例

次の例は、さまざまなモニタリング ルールの組み合わせの会話プロファイル構成を示しています。

例 1: AI コーチのルールが一致した場合

    conversation_profile     {
      name: "projects/agent-assist-console-demo/locations/global/conversationProfiles/your_new_conv_profile_id"
      interaction_monitoring_config {
        event_notification_config = {
            ...
        }
        alerting_config {
          rules {
            alert_rule_id: "agent coaching alert trigger rule(s) matched"
            description: "agent coaching alert trigger rule(s) matched"
            trigger_condition {
              metric_condition {
                metric_type: AGENT_COACHING_INSTRUCTIONS
                agent_coaching_config {
                  generator_name:    "projects/agent-assist-console-demo/locations/global/generators/newly_created_generator_id"
                }
                display_name: "agent coaching alert trigger rule(s) matched"
              }
            }
          }
          # Optional Tool config to retrieve customer name. If not required, skip setting the metadata_config.
          metadata_config = {
            ...
          }
        }
      }
    }
    update_mask {
      paths: "interaction_monitoring_config"
    }
    

例 2: 感情スコアが -0.01 未満

    conversation_profile     {
      name: "projects/agent-assist-console-demo/locations/global/conversationProfiles/your_new_conv_profile_id"
      interaction_monitoring_config {
        event_notification_config = {
            ...
        }
        alerting_config {
          rules {
            alert_rule_id: "customer sentiment negative"
            description: "negative sentiment"
            trigger_condition {
              metric_condition {
                metric_type: SENTIMENT
                value_range {
                  max_threshold: -0.01
                }
                display_name: "negative sentiment"
              }
            }
          }
          # Optional Tool config to retrieve customer name. If not required, skip setting the metadata_config.
          metadata_config = {
            ...
          }
        }
      }
    }
    update_mask {
      paths: "interaction_monitoring_config"
    }
    

例 3: 感情スコアが -0.01 未満で、AI コーチのルールが一致した場合

    conversation_profile     {
      name: "projects/agent-assist-console-demo/locations/global/conversationProfiles/your_new_conv_profile_id"
      interaction_monitoring_config {
        event_notification_config = {
            ...
        }
        alerting_config {
          # Required.
          rules {
            alert_rule_id: "sentiment is negative and agent coaching alert trigger rule(s) matched"
            description: "agent coaching alert trigger rule(s) matched and customer is unhappy"
            trigger_condition {
              and_condition {
                alert_conditions {
                  metric_condition {
                    metric_type: SENTIMENT_SCORE
                    value_range {
                      max_threshold: -0.01
                    }
                    display_name: "negative sentiment and agent coaching alert trigger rule(s) matched"
                  }
                }
                alert_conditions {
                  metric_condition {
                    metric_type: AGENT_COACHING_INSTRUCTIONS
                    agent_coaching_config {
                      generator_name: "projects/agent-assist-console-demo/locations/global/generators/newly_created_generator_id"
                    }
                    display_name: "negative sentiment and agent coaching alert trigger rule(s) matched"
                  }
                }
              }
            }
          }
          # Optional Tool config to retrieve customer name. If not required, skip setting the metadata_config.
          metadata_config = {
            ...
          }
        }
      }
    }
    update_mask {
      paths: "interaction_monitoring_config"
    }
    

例 4: AI コーチのルールが一致したか、感情スコアが -0.01 未満

    conversation_profile     {
      name: "projects/agent-assist-console-demo/locations/global/conversationProfiles/your_new_conv_profile_id"
      interaction_monitoring_config {
        event_notification_config = {
            ...
        }
        alerting_config {
          rules {
            alert_rule_id: "agent coaching alert trigger rule(s) matched"
            description: "agent coaching alert trigger rule(s) matched"
            trigger_condition {
              metric_condition {
                metric_type: AGENT_COACHING_INSTRUCTIONS
                agent_coaching_config {
                  generator_name:    "projects/agent-assist-console-demo/locations/global/generators/newly_created_generator_id"
                }
                display_name: "agent coaching alert trigger rule(s) matched"
              }
            }
          }
          rules {
            alert_rule_id: "customer sentiment negative"
            description: "negative sentiment"
            trigger_condition {
              metric_condition {
                metric_type: SENTIMENT
                value_range {
                  max_threshold: -0.01
                }
                display_name: "negative sentiment"
              }
            }
          }
          # Optional Tool config to retrieve customer name. If not required, skip setting the metadata_config.
          metadata_config = {
            ...
          }
        }
      }
    }
    update_mask {
      paths: "interaction_monitoring_config"
    }
    

ステップ 4: スーパーバイザー アシストを構成する

  1. アラートを受信するための Pub/Sub トピックを作成します。Agent Assist は、この Pub/Sub トピックを使用してアラートと指標を受信します。トピック ID をメモします。
  2. プロジェクトと Pub/Sub トピックの ID を Google に送信して、許可リストに登録します。

人間同士のモニタリング サービスは、次のイベントタイプを公開します。

  • 感情指標は、会話内のすべてのエンドユーザー ターンについて集計された感情の計算結果です。
  • アラート イベントは、感情が構成されたしきい値を超えたときに Agent Assist が生成する、ルール詳細を含む通知です。

スーパーバイザー アシストは、これらの 2 つのイベントのさまざまな統合要件に対応するため、次の標準構成をサポートしています。これらの設定は、インタラクション モニタリングの構成に含めることができます。

  • デフォルト モード: 条件が満たされると、アラートがすぐに公開されます。感情分析の指標は、アラートが開始された後にのみ公開されます。
  • 純粋なモニタリング モード: 感情指標はすべてのターンで継続的に公開されます。アラート イベントは無視されます。
  • Publish all モードの動作: 両方のタイプのイベントが常に無条件で公開されます。

ステップ 5a: チャットをテストする

チャット シミュレータでスーパーバイザー アシストをテストする手順は次のとおりです。

  1. モニタリング シミュレータに移動します。

    https://agentassist.cloud.google.com/projects/project-id/locations/location-id/human-supervisor
    
  2. [設定] 設定 をクリックし、[Human Agents] を選択します。

  3. ブラウザで別のタブを開き、会話プロファイルを使用して Chat 会話シミュレータに移動します。

  4. 会話シミュレータで会話を開始します。モニタリング シミュレータに文字起こしと感情スコアが表示されます。

ステップ 5b: 音声をテストする

音声シミュレータでスーパーバイザー アシストをテストする手順は次のとおりです。

  1. モニタリング シミュレータに移動します。

    https://agentassist.cloud.google.com/projects/project-id/locations/location-id/human-supervisor
    
  2. [設定] [設定] をクリックし、[人間のエージェント] と [電話のみをモニタリングする] を選択します。

  3. ブラウザで別のタブを開き、会話プロファイルを使用して音声会話シミュレータに移動します。

  4. [通話] [音声に切り替え] をクリックします。

  5. エージェントの電話番号を入力します。

  6. 別の電話で、画面に表示された新しい番号に電話をかけます。

スコアマップ

スーパーバイザー アシストでは、次の 2 つのスコアが提供されます。

  • ターンごとの感情スコアは、-1 ~ 1 の離散的な浮動小数点値です。
  • 最新の感情スコアは、-1 ~ 1 の連続した浮動小数点値です。

継続的なポイントまでのセンチメント スコアを、さまざまなビジネス ユニットに適したカスタム スコアにマッピングできます。次の例は、マッピング アプローチの 1 つを示しています。

マッピングの JavaScript コードの例:

/**
 * Maps a score to a bucket index (1-10) based on 11 boundary points.
 * * @param {number} score - The input score (between -1 and 1)
 * @param {number[]} boundaries - An array of exactly 11 numbers sorted in ascending order.
 * @return{number} The bucket index (1 to 10).
 */
function getBucketIndex(score, boundaries) {
  // 1. Validation: Ensure we have exactly 11 boundary points
  if (!Array.isArray(boundaries) || boundaries.length !== 11) {
    throw new Error("Boundaries must be an array of exactly 11 points.");
  }

  // 2. Validate Input Score Range 
  if (typeof score !== 'number' || score < -1 || score > 1) {
    throw new Error(`Input score ${score} is out of bounds. Must be between -1 and 1.`)
  }

  // 3. Iterate through boundaries to find the slot
  // We start checking from index 1 (the first upper bound)
  for (let i = 1; i < boundaries.length; i++) {
    // If the score is strictly less than the current boundary,
    // it belongs to the bucket corresponding to this index.
    if (score <= boundaries[i]) {
      return i;
    }
  }

  // Fallback (should be covered by step 2 validation, but ensures integer return)
  return -1;
}


// --- Example Usage ---

// Create 11 boundary points from -1 to 1
// [-1.0, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
const boundaries = [];
for (let i = 0; i <= 10; i++) {
  // Creating points: -1 + (i * 0.2)
  boundaries.push(parseFloat((-1 + (i * 0.2)).toFixed(1))); 
}

console.log("Boundaries:", boundaries);

// Test Cases
console.log(`Score -0.9 maps to Bucket: ${getBucketIndex(-0.9, boundaries)}`); // Expected: 1
console.log(`Score -0.8 maps to Bucket: ${getBucketIndex(-0.8, boundaries)}`); // Expected: 2 (Inclusive lower)
console.log(`Score 0.0 maps to Bucket: ${getBucketIndex(0.0, boundaries)}`);   // Expected: 6
console.log(`Score 0.95 maps to Bucket: ${getBucketIndex(0.95, boundaries)}`); // Expected: 10
console.log(`Score 1.0 maps to Bucket: ${getBucketIndex(1.0, boundaries)}`);   // Expected: 10 (Inclusive upper)

必要に応じて、次のコードを使用してマッピングを最適化し、マッピングされた予測と CX スコアの相関関係を最大化するしきい値を自動的に決定します。データに対してこの 1 回限りの最適化を行うと、手動で構成するのではなく、結果として得られたデータドリブン境界を使用できます。

Pub/Sub アクティビティ通知

センチメント指標とアラートの両方が、構成された 1 つの Pub/Sub トピックにパブリッシュされます。ペイロードはイベントタイプによって異なります。

感情分析指標の Pub/Sub メッセージ ペイロード:

{
  "data": "{\"metric\":{\"metricType\":\"SENTIMENT_SCORE\",\"value\":{\"createTime\":\"2024-01-01T00:00:00.000Z\",\"sentiment\":{\"score\":0.5,\"magnitude\":0.5},\"advancedValues\":{\"exponentialMovingAverageValue\":0.5}},\"conversation\":\"projects/your-project-id/locations/global/conversations/conversation_id\",\"message\":{\"name\":\"projects/your-project-id/locations/global/conversations/conversation_id/messages/message_id\",\"content\":\"ok\",\"languageCode\":\"en-US\",\"participant\":\"projects/your-project-id/locations/global/conversations/conversation_id/participants/participant_id\",\"participantRole\":\"END_USER\",\"sendTime\":\"2024-01-01T00:00:00.000Z\"}}}",
  "attributes": {
    "conversation_id": "conversation_id"
  }
}

pubsub メッセージ ペイロードを変更する例:

{"data": "{\"alert\":{\"name\":\"projects/project_id/locations/location_id/interactionMonitoringAlerts/alert_id\",\"conversation\":\"projects/project_id/locations/location_id/conversations/conversation_id\",\"alertState\":\"CREATED\",\"alertMetadata\":{\"alertTriggerRules\":[{\"alertRuleId\":\"negative-sentiment\",\"description\":\"dummy_description\",\"Strong negative sentiment detected in last 30 seconds\":[{\"metricType\":\"SENTIMENT_SCORE\",\"values\":[{\"createTime\":\"2024-01-01T00:00:00.000Z\",\"sentiment\":{\"score\":0.0,\"magnitude\":0.0}}]}]}],\"channelType\":\"CHAT\"},\"createTime\":\"2024-01-01T00:00:00.000Z\"}}",
  "attributes": {
    "conversation_id": "conversation_id"
  }
}

API リファレンス

AnalyzeContent:

  • ユースケース: エンドユーザーと人間のエージェント間のチャット会話をモニタリングします。
  • テスト方法:
    • コンソール シミュレータ: Agent Assist コンソール チャット シミュレータを使用します。
    • API 統合: 直接 HTTP リクエストまたは RPC リクエストを送信します([サンプルコード] を参照)。

StreamingAnalyzeContent

  • ユースケース: エンドユーザーと人間のエージェント間の音声会話をモニタリングします。
  • テスト方法:
    • コンソール シミュレータ: Agent Assist コンソールの音声シミュレータを使用します。
    • API 統合: 直接 HTTP リクエストまたは RPC リクエストを送信します([サンプルコード] を参照)。

ListMessages:

  • 会話の文字起こし(エージェントと顧客の両方のターン)の完全なリストを取得します。
  • ベスト プラクティス: この API は、音声会話でストリームの終了後にすべてのターンの最終的な修正済み文字起こしを確認する場合に特に便利です。

ListInteractionMonitoringMetrics: 特定の会話について計算および集計されたすべての感情指標を取得します。

リクエスト ペイロードの例:

{
  "parent": "projects/{project-id}/locations/{location-id}",
  "conversation":
"projects/{project-id}/locations/{location-id}/conversations/{conversation-id}"
}

レスポンス ペイロードの例:

{
  "interactionMonitoringMetrics": [{
    "metricType": "SENTIMENT_SCORE",
    "values": {
      "createTime": "2025-12-01T22:20:49.925Z",
      "sentiment": {
        "score": -1.0,
        "magnitude": 1.0
      },
      "advancedValues": {
        "movingAverageValue": -0.4994999999762513
      }
    }, {
      "createTime": "2025-12-01T22:20:21.027Z",
      "sentiment": {
        "score": 0.001,
        "magnitude": 0.001
      },
      "advancedValues": {
        "movingAverageValue": -0.4994999999762513
      }
    },
      "advancedValues": {
      }
    }]
}

ListInteractionMonitoringAlert: 生成されたアラートを取得します。プロジェクト全体を対象にすることも、特定の会話にフィルタすることもできます。

プロジェクト内のすべてのアラートをクエリするには:

{
  "parent": "projects/{project-id}/locations/{location-id}"
}

**特定の会話 ID のアラートをクエリするには **

{
  "parent": "projects/{project-id}/locations/{location-id}",
  "filter": "context_id=projects/{project-id}/locations/{location-id}/conversations/{conversation-id}"
}

フィルタ オプション。ユーザーは、アラートのステータスなどの追加のフィルタ条件を適用できます。

alert_state=CREATED,alert_state=ACKNOWLEDGED