mcpField
C
conversational-ai-flow

conversational-ai-flow

github.com/dengineproblemデザイン・UI89 回インストール
リポジトリ

conversational-ai-flow について

会話型 AI フローの設計と実装を支援するスキルです。会話状態、意図ルーティング、スロット補完、エラー回復、応答生成、フロー指標を扱います。

主な機能

  1. 01会話状態とフロー位置の管理
  2. 02意図に基づくフロールーティング
  3. 03スロット補完と検証
  4. 04誤解が起きた際の回復策
  5. 05文脈に応じたマルチモーダル応答
  6. 06完了率とフォールバック指標

活用シーン

  1. 01予約会話フローの設計
  2. 02会話で不足情報を確認
  3. 03誤解が続く場合の回復
  4. 04完了率と離脱の監視

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/dengineproblem/agents-monorepo --skill conversational-ai-flow

インストール後、Claude Code で/conversational-ai-flowを入力して読み込まれたか確認します。

詳細

会話型 AI フローのエキスパート

会話型 AI フローの設計と実装に関するエキスパートです。

設計の基本原則

状態管理
class ConversationState:
    def __init__(self):
        self.current_intent = None
        self.entities = {}
        self.conversation_history = []
        self.flow_position = "start"
        self.confidence_threshold = 0.7

    def update_context(self, user_input, intent, entities):
        self.conversation_history.append({
            "user_input": user_input,
            "intent": intent,
            "entities": entities
        })
        self.entities.update(entities)
        self.current_intent = intent

フローのアーキテクチャパターン

インテントベースのルーティング
flows:
  booking_flow:
    entry_conditions:
      - intent: "book_appointment"
    steps:
      - name: "collect_datetime"
        prompt: "When would you like to schedule?"
        validation: "datetime_validator"
      - name: "confirm_booking"
        prompt: "Confirm booking on {datetime}?"
        actions: ["create_booking", "send_confirmation"]

  fallback_flow:
    triggers: ["low_confidence", "unknown_intent"]
    strategy: "clarification_questions"
スロットフィリングパターン
def slot_filling_handler(state, required_slots):
    missing_slots = [s for s in required_slots if s not in state.entities]

    if missing_slots:
        return generate_slot_prompt(missing_slots[0], state)

    return proceed_to_next_step(state)

エラー処理と復旧

段階的な情報開示
class ErrorRecovery:
    def handle_misunderstanding(self, state, attempt_count):
        strategies = {
            1: "I didn't quite catch that. Could you rephrase?",
            2: "Let me try differently. Are you looking to: [options]?",
            3: "Let me connect you with a human agent."
        }
        return strategies.get(attempt_count, strategies[3])

応答の生成

コンテキストに応じたテンプレート
class ResponseGenerator:
    templates = {
        "confirmation": [
            "Got it! {summary}. Is that correct?",
            "Let me confirm: {summary}. Does this look right?"
        ],
        "progress": [
            "Great! We've got {completed}. Next, {next_step}.",
            "Perfect! Just need {remaining} and we're done."
        ]
    }

マルチモーダル応答

{
  "response_type": "rich",
  "text": "Here are your options:",
  "components": [
    {
      "type": "quick_replies",
      "options": [
        {"title": "Schedule Appointment", "payload": "intent:book"},
        {"title": "Check Status", "payload": "intent:status"}
      ]
    }
  ]
}

分析と最適化

def track_flow_metrics(conversation_id, metrics):
    return {
        "completion_rate": metrics.completed / metrics.started,
        "average_turns": metrics.total_turns / metrics.conversations,
        "fallback_rate": metrics.fallbacks / metrics.total_turns,
        "abandonment_points": identify_drop_off_points(conversation_id)
    }

ベストプラクティス

  • ボットの明確な個性と口調を定義します
  • ユーザーのニーズを先回りして把握します
  • 長い会話では要約を活用します
  • すべての経路とエッジケースをテストします
  • 改善のために実際の会話を監視します

コメント