客服機器人

PR Ready

基於意圖分類的路由,搭配專科代理與人工升級處理。

7 個節點 · 8 條連接pr ready
langgraphlangchainchatbotsupportrouting
視覺化
接收客戶訊息api

來自聊天元件或訊息平台的傳入訊息。

sequential分類意圖
分類意圖agent

判斷意圖類別與信心評分。

conditional帳務專員
conditional技術專員
conditional一般服務代理
conditional轉接真人客服
帳務專員agent

處理退款、發票、方案變更與付款問題。

sequential格式化回覆
技術專員agent

處理錯誤回報、API 問題與整合協助。

sequential格式化回覆
一般服務代理agent

處理常見問題、帳號資訊與一般性詢問。

sequential格式化回覆
格式化回覆agent

將專員輸出整理為友善的客戶訊息。

轉接真人客服human

當信心評分低於門檻時,轉接至真人客服人員。

ex-langgraph-customer-support.osop.yaml
# LangGraph Customer Support Bot — OSOP Portable Workflow
#
# A stateful support agent: classifies the user's intent, routes to a
# specialist sub-graph (billing, technical, general), generates a response,
# and escalates to a human when confidence is low.
#
# Run with LangGraph or validate: osop validate langgraph-customer-support.osop.yaml

osop_version: "1.0"
id: "langgraph-customer-support"
name:"客服機器人"
description:"基於意圖分類的路由,搭配專科代理與人工升級處理。"
version: "1.0.0"
tags: [langgraph, langchain, chatbot, support, routing]

nodes:
  - id: "receive_message"
    type: "api"
    subtype: "webhook"
    name: "接收客戶訊息"
    description: "來自聊天元件或訊息平台的傳入訊息。"

  - id: "classify_intent"
    type: "agent"
    subtype: "llm"
    name: "分類意圖"
    description: "判斷意圖類別與信心評分。"
    config:
      model: "gpt-4o-mini"
      output_schema: { intent: "string", confidence: "float" }

  - id: "billing_specialist"
    type: "agent"
    subtype: "llm"
    name: "帳務專員"
    description: "處理退款、發票、方案變更與付款問題。"
    config:
      tools: [lookup_subscription, issue_refund, generate_invoice]

  - id: "technical_specialist"
    type: "agent"
    subtype: "llm"
    name: "技術專員"
    description: "處理錯誤回報、API 問題與整合協助。"
    config:
      tools: [search_docs, check_status_page, create_ticket]

  - id: "general_agent"
    type: "agent"
    subtype: "llm"
    name: "一般服務代理"
    description: "處理常見問題、帳號資訊與一般性詢問。"

  - id: "generate_response"
    type: "agent"
    subtype: "llm"
    name: "格式化回覆"
    description: "將專員輸出整理為友善的客戶訊息。"

  - id: "human_escalation"
    type: "human"
    subtype: "review"
    name: "轉接真人客服"
    description: "當信心評分低於門檻時,轉接至真人客服人員。"

edges:
  - from: "receive_message"
    to: "classify_intent"
    mode: "sequential"
  - from: "classify_intent"
    to: "billing_specialist"
    mode: "conditional"
    when: "intent == 'billing'"
  - from: "classify_intent"
    to: "technical_specialist"
    mode: "conditional"
    when: "intent == 'technical'"
  - from: "classify_intent"
    to: "general_agent"
    mode: "conditional"
    when: "intent == 'general'"
  - from: "classify_intent"
    to: "human_escalation"
    mode: "conditional"
    when: "confidence < 0.6"
    label: "Low confidence — escalate"
  - from: "billing_specialist"
    to: "generate_response"
    mode: "sequential"
  - from: "technical_specialist"
    to: "generate_response"
    mode: "sequential"
  - from: "general_agent"
    to: "generate_response"
    mode: "sequential"