Types of Events/Webhooks for Conversational AI Agents
These are system and user-driven triggers that occur during or after interactions with the agent.
Post-Conversation Events
-
Conversation Ended
- Trigger sentiment analysis to evaluate user satisfaction.
- Archive conversation data in a knowledge base for future reference.
- Generate a conversation summary for the user or support team.
-
Intent Matched
- Trigger specific workflows based on identified intents (e.g., booking appointments, fetching data).
- Activate fallback workflows if no intent is matched.
-
Entity Extraction
- Populate extracted entities (e.g., dates, locations) into external systems like CRMs or ERPs.
- Notify downstream systems when specific entities (e.g., personal identifiers) are detected.
-
Session Timeout
- Log the incomplete session for analysis or re-engagement purposes.
- Automatically re-initiate the session with a follow-up message or reconnect workflow.
-
Unhandled Query
- Trigger escalation to a human agent.
- Add the query to a training backlog for intent retraining.
-
Context Handover
- Seamlessly pass user context to another AI agent or human operator.
- Notify the downstream system of the state variables (e.g., user preferences, unresolved issues).
Real-Time Events During Chat
-
Typing Indicator Triggered
- Monitor user typing patterns to pre-emptively load AI responses.
- Adapt the agent's tone dynamically based on detected urgency or frustration.
-
Token or Response Length Breach
- Abort lengthy responses if the maximum token limit is exceeded.
- Switch to a summarization workflow for large outputs.
-
Interruptions
- Listen for mid-response user inputs and dynamically adjust AI behavior (e.g., reprioritize tasks or reset the conversation flow).
-
Voice-to-Text Transcription
- Trigger text cleanup, language translation, or ASR (automatic speech recognition) fine-tuning pipelines.
Events for Image and File Uploads
These are specific to AI agents that process multimedia inputs.
-
Image Upload
- Image Classification: Trigger object detection or scene analysis workflows (e.g., tagging product categories in an e-commerce bot).
- OCR (Optical Character Recognition): Extract text from images and inject the data into structured workflows.
- Image Moderation: Scan for inappropriate content using image moderation APIs.
- Auto-Resize or Format Conversion: Process images for compatibility with downstream systems.
-
File Upload
- File Type Validation: Trigger actions based on supported formats (e.g., process PDFs for invoices, ignore unsupported extensions).
- Text Extraction: Use NLP pipelines to analyze the contents of documents.
- Data Mapping: Match file data to predefined fields in a database (e.g., uploading customer forms for automatic onboarding).
UI Interaction Events (Button Clicks, Dropdowns, etc.)
These events track user interactions within a conversational interface or external UI.
-
Button Click
- Trigger API calls for specific actions (e.g., submitting forms, triggering workflows like payments).
- Activate conditional responses or dynamic UI updates (e.g., revealing new options based on selection).
-
Carousel Selection
- Dynamically retrieve data (e.g., pulling item details when a product card is selected).
- Log selection data for personalized future recommendations.
-
Quick Reply/Chip Selection
- Pre-fill or auto-submit forms based on user selection.
- Shorten conversation flows by jumping directly to predefined intents.
-
Dropdown Interaction
- Trigger workflows based on hierarchical menu selections (e.g., choosing categories and subcategories for detailed support).
- Update dropdown options dynamically based on user state or API results.
-
Checkbox/Toggle Events
- Save user preferences (e.g., opting into notifications or privacy settings).
- Adjust AI agent behaviors based on toggled options (e.g., enabling verbose vs. concise responses).
Webhooks for AI Agents
Webhooks allow AI agents to interact with external systems in real time.
Conversational Webhooks
-
Live Query Webhook
- Retrieve real-time data (e.g., weather, stock prices) based on user queries.
- Send API responses back into the conversation context.
-
Human Handoff Webhook
- Push conversation context to a human operator dashboard.
- Notify the agent when the human completes the interaction to resume AI workflows.
-
Sentiment Alerts
- Notify the support team when user sentiment drops below a threshold.
- Automatically offer escalations for frustrated users.
-
Live Event Tracking
- Send webhook notifications for ongoing conversations, enabling dashboards or analytics updates.
Multimedia Webhooks
- Image Analysis Webhook
- Send uploaded images to third-party APIs for advanced processing (e.g., facial recognition, logo detection).
- File Handling Webhook
- Forward uploaded files to cloud storage, document management systems, or data extraction pipelines.
Behavioral Webhooks
- Feedback Submission
- Trigger real-time logging or survey workflows upon user rating submissions.
- Click Tracking
- Notify downstream systems (e.g., analytics) when users click on links or buttons in chat responses.
Advanced Examples
Event: Multi-Step Interaction
- Scenario: User uploads a document, selects an option, and clicks "Process."
- Flow:
- Trigger file upload listener → Extract data with OCR.
- Listen for dropdown selection → Map data fields to dropdown options.
- Click event → Submit processed data to CRM and send acknowledgment email.
Webhook: Dynamic Content Retrieval
- Scenario: AI agent handles booking requests with live availability.
- Flow:
- Conversation event detects booking intent.
- Webhook sends availability query to booking API.
- Response updates the agent’s message in real time with available slots.
Cron Job: Interaction Cleanup
- Scenario: Clean up unresolved interactions every night.
- Flow:
- Identify incomplete sessions via a database cron job.
- Trigger follow-up emails or retry workflows.