Chapter 10: Advanced AI Integration & Implementation -- 10.5 Dialogflow CX Architecture & Setup¶
10.5 Dialogflow CX Architecture & Setup¶
10.5.1 Dialogflow CX Concepts Overview¶
Dialogflow CX uses a state-machine based architecture that differs significantly from traditional intent-based conversational AI. Understanding these concepts is essential for proper implementation.
Core Architecture Components¶
+-----------------------------------------------------------------------------+
| DIALOGFLOW CX ARCHITECTURE MODEL |
+-----------------------------------------------------------------------------+
| |
| +---------------------------------------------------------------------+ |
| | DIALOGFLOW CX AGENT | |
| | (Abhi VA - asia-south1) | |
| | | |
| | +-------------------------------------------------------------+ | |
| | | FLOWS | | |
| | | (Conversation modules - reusable building blocks) | | |
| | | | | |
| | | +---------------+ +---------------+ +---------------+ | | |
| | | | Default Start | | Order Flow | | Support Flow | | | |
| | | | Flow | | | | | | | |
| | | | | | * Order Status| | * Troubleshoot| | | |
| | | | * Welcome | | * Order Track | | * General Help| | | |
| | | | * Main Menu | | * Order Cancel| | * Escalation | | | |
| | | | * Routing | | | | | | | |
| | | +-------+-------+ +-------+-------+ +-------+-------+ | | |
| | | | | | | | |
| | +----------+------------------+------------------+-----------+ | |
| | | | | | |
| | +----------+------------------+------------------+-----------+ | |
| | | PAGES | | |
| | | (Conversation states within a flow) | | |
| | | | | |
| | | Each Page contains: | | |
| | | +- Entry Fulfillment (what to say/do on entry) | | |
| | | +- Parameters (data to collect) | | |
| | | +- Routes (transitions based on intents/conditions) | | |
| | | +- Event Handlers (no-match, no-input, etc.) | | |
| | | | | |
| | | Example Pages in Order Flow: | | |
| | | [Start] -> [Collect Order#] -> [Lookup] -> [Provide Status] | | |
| | | | | |
| | +-------------------------------------------------------------+ | |
| | | |
| | +-------------------------------------------------------------+ | |
| | | INTENTS | | |
| | | (User intention recognition) | | |
| | | | | |
| | | * Training phrases (what users might say) | | |
| | | * Parameters (entities to extract) | | |
| | | * Reusable across flows/pages | | |
| | | | | |
| | | Abhavtech Intents: 10 complex + system defaults | | |
| | +-------------------------------------------------------------+ | |
| | | |
| | +-------------------------------------------------------------+ | |
| | | ENTITIES | | |
| | | (Data types to extract from conversation) | | |
| | | | | |
| | | System Entities: @sys.number, @sys.date, @sys.phone | | |
| | | Custom Entities: @order_number, @product_name, @region | | |
| | +-------------------------------------------------------------+ | |
| | | |
| | +-------------------------------------------------------------+ | |
| | | WEBHOOKS | | |
| | | (External API integration for dynamic data) | | |
| | | | | |
| | | * abhavtech-fulfillment (order, account, billing lookups) | | |
| | | * Timeout: 10 seconds | | |
| | | * Partial responses enabled | | |
| | +-------------------------------------------------------------+ | |
| | | |
| +---------------------------------------------------------------------+ |
| |
+-----------------------------------------------------------------------------+
Key Differences from Dialogflow ES¶
| Aspect | Dialogflow ES | Dialogflow CX |
|---|---|---|
| Conversation Model | Intent-based | State-machine (Flows/Pages) |
| Context Management | Time-based contexts | Page-based state |
| Reusability | Limited | Flows are reusable modules |
| Multi-turn | Complex with contexts | Native via page transitions |
| Version Control | Basic | Full environments (draft/prod) |
| Visual Editor | Basic | Advanced flow visualization |
| Multi-language | Per-intent | Agent-wide with localization |
10.5.2 GCP Project Configuration¶
GCP Project Details for Abhavtech¶
+-----------------------------------------------------------------------------+
| ABHAVTECH GCP PROJECT SPECIFICATION |
+-----------------------------------------------------------------------------+
| |
| PROJECT DETAILS: |
| ======================================================================= |
| |
| Project Name: Abhavtech WxCC AI |
| Project ID: abhavtech-wxcc-ai |
| Project Number: [Auto-assigned by GCP] |
| Organization: abhavtech.com |
| Billing Account: [Abhavtech billing account] |
| |
| REGIONAL CONFIGURATION: |
| ======================================================================= |
| |
| Primary Region: asia-south1 (Mumbai, India) |
| Rationale: Data residency compliance for India operations |
| |
| [!]️ IMPORTANT: Dialogflow CX agent region cannot be changed after |
| creation. All data processing occurs in the selected region. |
| |
| ENABLED APIs: |
| ======================================================================= |
| |
| | API Name | Purpose | |
| |-----------------------------------|-------------------------------| |
| | Dialogflow API | Core CX functionality | |
| | Cloud Speech-to-Text API | Voice transcription | |
| | Cloud Text-to-Speech API | Response synthesis | |
| | Cloud Functions API | Webhook hosting | |
| | Cloud Build API | Function deployment | |
| | Cloud Run API | Alternative webhook hosting | |
| | Secret Manager API | Credential storage | |
| |
| SERVICE ACCOUNT: |
| ======================================================================= |
| |
| Name: wxcc-ccai-connector |
| Email: wxcc-ccai-connector@abhavtech-wxcc-ai.iam. |
| gserviceaccount.com |
| Roles: * Dialogflow API Admin |
| * Dialogflow API Client |
| Key: JSON key file (secured in credential vault) |
| |
| IAM PERMISSIONS MATRIX: |
| ======================================================================= |
| |
| | Principal | Role | Purpose | |
| |-------------------------|-------------------------|-------------------| |
| | wxcc-ccai-connector | Dialogflow API Admin | WxCC integration | |
| | wxcc-ccai-connector | Dialogflow API Client | API calls | |
| | admin@abhavtech.com | Project Owner | Full admin | |
| | devops@abhavtech.com | Dialogflow API Admin | Agent management | |
| | cc-team@abhavtech.com | Dialogflow API Reader | Testing/review | |
| |
+-----------------------------------------------------------------------------+
10.5.3 Agent Configuration¶
Dialogflow CX Agent Specification¶
+-----------------------------------------------------------------------------+
| DIALOGFLOW CX AGENT SPECIFICATION |
+-----------------------------------------------------------------------------+
| |
| AGENT DETAILS: |
| ======================================================================= |
| |
| Display Name: Abhi VA |
| Agent ID: [Auto-generated UUID] |
| Location: asia-south1 |
| Default Language: English (en) |
| Additional Languages: Hindi (hi) |
| Time Zone: Asia/Kolkata (IST) |
| |
| SPEECH SETTINGS: |
| ======================================================================= |
| |
| Speech-to-Text: |
| | Setting | Value | |
| |----------------------------------|-------------------------------| |
| | Speech Model | phone_call (enhanced) | |
| | Speech Adaptation | Enabled | |
| | Audio Encoding | LINEAR16 | |
| | Sample Rate | 8000 Hz | |
| | Automatic Punctuation | Enabled | |
| | Profanity Filter | Enabled | |
| |
| Text-to-Speech (English - en-IN): |
| | Setting | Value | |
| |----------------------------------|-------------------------------| |
| | Voice Name | en-IN-Neural2-A | |
| | Voice Gender | Male | |
| | Speaking Rate | 1.0 | |
| | Pitch | 0 | |
| |
| Text-to-Speech (Hindi - hi-IN): |
| | Setting | Value | |
| |----------------------------------|-------------------------------| |
| | Voice Name | hi-IN-Neural2-A | |
| | Voice Gender | Male | |
| | Speaking Rate | 1.0 | |
| | Pitch | 0 | |
| |
| ADVANCED SPEECH SETTINGS: |
| ======================================================================= |
| |
| | Setting | Value | Purpose | |
| |----------------------------------|----------|----------------------| |
| | No-speech Timeout | 5 sec | Wait for speech | |
| | End of Speech Timeout | 2 sec | Detect utterance end | |
| | Max Speech Length | 60 sec | Long utterances | |
| | Barge-in | Enabled | Allow interruption | |
| | Partial Responses | Enabled | Reduce latency | |
| | Single Utterance Mode | Disabled | Multi-turn support | |
| |
| LOGGING CONFIGURATION: |
| ======================================================================= |
| |
| | Setting | Status | Purpose | |
| |----------------------------------|----------|----------------------| |
| | Cloud Logging | Enabled | Audit and debug | |
| | Conversation History | Enabled | Training data | |
| | Interaction Logging | Enabled | Performance metrics | |
| | Stackdriver Integration | Enabled | Monitoring | |
| |
+-----------------------------------------------------------------------------+