Skip to content

AI Features

HelpDesk Pro integrates with OpenAI to provide intelligent automation and insights for your customer support operations. This guide covers all AI-powered features and how to configure them.

Overview

The AI features in HelpDesk Pro leverage OpenAI's powerful language models to:

  • Automatically classify tickets based on content and context
  • Generate response suggestions for common queries
  • Analyze customer sentiment in real-time
  • Provide predictive analytics for support trends
  • Optimize response times with smart routing

Setup and Configuration

1. OpenAI API Setup

Get OpenAI API Key

  1. Visit OpenAI Platform
  2. Create an account or sign in
  3. Navigate to API Keys section
  4. Create a new API key
  5. Copy the key for configuration

Configure in HelpDesk Pro

  1. Admin Panel Configuration

    Settings → AI Configuration → OpenAI Settings
  2. Environment Variables

    bash
    OPENAI_API_KEY=sk-your-api-key-here
    OPENAI_ORGANIZATION=org-your-org-id
    OPENAI_MODEL=gpt-4
    OPENAI_MAX_TOKENS=1000
    OPENAI_TEMPERATURE=0.7
  3. Test Connection

    • Use the "Test Connection" button in admin panel
    • Verify API key is working correctly

2. AI Feature Toggles

Enable/disable specific AI features:

php
// In config/ai.php
'features' => [
    'ticket_classification' => true,
    'response_suggestions' => true,
    'sentiment_analysis' => true,
    'predictive_analytics' => true,
    'auto_routing' => true,
],

Smart Ticket Classification

AI How It Works

The AI analyzes incoming tickets and automatically:

  1. Categorizes tickets into appropriate categories
  2. Assigns priority levels based on content analysis
  3. Routes tickets to the right department
  4. Tags tickets with relevant keywords
  5. Provides confidence scores for each classification

OpenAI Configuration

Classification Rules

php
// Example classification configuration
'classification' => [
    'categories' => [
        'technical' => [
            'keywords' => ['error', 'bug', 'issue', 'problem', 'not working'],
            'confidence_threshold' => 0.8,
        ],
        'billing' => [
            'keywords' => ['payment', 'invoice', 'refund', 'charge'],
            'confidence_threshold' => 0.7,
        ],
        'general' => [
            'keywords' => ['question', 'help', 'information'],
            'confidence_threshold' => 0.6,
        ],
    ],
],

Training the AI

  1. Historical Data Learning

    • AI learns from past ticket classifications
    • Improves accuracy over time
    • Adapts to your specific use cases
  2. Manual Corrections

    • When you correct AI classifications
    • System learns from your feedback
    • Improves future accuracy

AI Usage Examples

Automatic Classification

php
// When a new ticket is created
$ticket = new Ticket([
    'subject' => 'Login not working after update',
    'description' => 'I cannot log into my account after the recent update...',
]);

// AI automatically classifies
$classification = $aiService->classifyTicket($ticket);
// Result: Category: 'technical', Priority: 'high', Confidence: 0.92

Manual Override

php
// Admin can override AI classification
$ticket->update([
    'category_id' => $correctCategoryId,
    'ai_classification_override' => true,
    'ai_confidence' => $originalConfidence,
]);

AI Response Suggestions

AI How It Works (2)

The AI analyzes ticket content and suggests appropriate responses:

  1. Context Analysis - Understands the customer's issue
  2. Response Generation - Creates relevant response suggestions
  3. Tone Matching - Matches your brand's communication style
  4. Template Integration - Incorporates your existing templates
  5. Personalization - Adapts to customer history and preferences

OpenAI Configuration (2)

Response Templates

php
// Configure response templates
'response_templates' => [
    'greeting' => 'Hello {{customer_name}},',
    'closing' => 'Best regards,<br>{{agent_name}}',
    'tone' => 'professional', // professional, friendly, formal
],

Suggestion Settings

php
'suggestions' => [
    'max_suggestions' => 3,
    'include_templates' => true,
    'include_custom_responses' => true,
    'confidence_threshold' => 0.7,
],

AI Usage Examples (2)

Getting Suggestions

php
// Get AI response suggestions for a ticket
$suggestions = $aiService->getResponseSuggestions($ticket);

// Example response:
[
    [
        'text' => 'Thank you for contacting us about the login issue...',
        'confidence' => 0.89,
        'template_id' => 'login_issue_template',
    ],
    [
        'text' => 'I understand you\'re experiencing difficulties...',
        'confidence' => 0.76,
        'template_id' => null,
    ],
]

Using Suggestions

  1. View Suggestions - AI suggestions appear in the ticket reply interface
  2. Select and Edit - Choose a suggestion and modify as needed
  3. Send Response - Use the AI-generated response or create your own
  4. Feedback - Rate the suggestion quality to improve AI

Sentiment Analysis

AI How It Works (3)

The AI analyzes customer communications to:

  1. Detect Emotions - Identifies customer sentiment (positive, negative, neutral)
  2. Escalate Urgency - Flags frustrated or angry customers
  3. Route Appropriately - Sends high-priority cases to senior agents
  4. Track Trends - Monitors overall customer satisfaction
  5. Predict Churn - Identifies customers at risk of leaving

OpenAI Configuration (3)

Sentiment Thresholds

php
'sentiment' => [
    'thresholds' => [
        'positive' => 0.6,
        'neutral' => 0.4,
        'negative' => -0.4,
        'critical' => -0.8,
    ],
    'escalation_rules' => [
        'critical' => 'immediate_escalation',
        'negative' => 'priority_routing',
    ],
],

AI Usage Examples (3)

Real-time Analysis

php
// Analyze sentiment of incoming message
$sentiment = $aiService->analyzeSentiment($message);

// Example result:
[
    'score' => -0.75, // -1 (very negative) to 1 (very positive)
    'label' => 'critical',
    'confidence' => 0.92,
    'emotions' => ['frustration', 'anger'],
    'escalation_required' => true,
]

Dashboard Integration

php
// Sentiment trends in dashboard
$sentimentTrends = $aiService->getSentimentTrends($dateRange);

// Example result:
[
    'overall_sentiment' => 0.2, // Slightly positive
    'trend' => 'improving',
    'critical_tickets' => 5,
    'satisfaction_score' => 7.8,
]

Predictive Analytics

AI How It Works (4)

The AI analyzes historical data to predict:

  1. Ticket Volume - Forecasts future ticket loads
  2. Response Times - Predicts how long tickets will take
  3. Agent Workload - Optimizes agent assignments
  4. Customer Satisfaction - Predicts satisfaction scores
  5. Resource Needs - Identifies when to scale up

OpenAI Configuration (4)

Analytics Settings

php
'analytics' => [
    'prediction_horizon' => 30, // days
    'confidence_interval' => 0.95,
    'update_frequency' => 'daily',
    'models' => [
        'ticket_volume' => 'time_series',
        'response_time' => 'regression',
        'satisfaction' => 'classification',
    ],
],

AI Usage Examples (4)

Volume Forecasting

php
// Predict ticket volume for next week
$forecast = $aiService->predictTicketVolume($days = 7);

// Example result:
[
    'predicted_volume' => 245,
    'confidence_interval' => [220, 270],
    'trend' => 'increasing',
    'peak_days' => ['Monday', 'Tuesday'],
    'recommendations' => [
        'Schedule additional agents for Monday-Tuesday',
        'Prepare for 15% increase in volume',
    ],
]

Performance Optimization

php
// Get optimization recommendations
$recommendations = $aiService->getOptimizationRecommendations();

// Example result:
[
    'agent_scheduling' => [
        'recommendation' => 'Add 2 agents during 2-4 PM',
        'impact' => 'Reduce response time by 23%',
    ],
    'category_routing' => [
        'recommendation' => 'Route billing tickets to specialized team',
        'impact' => 'Improve resolution time by 18%',
    ],
]

Auto-Routing and Assignment

AI How It Works (5)

The AI automatically routes tickets based on:

  1. Content Analysis - Understands ticket requirements
  2. Agent Expertise - Matches tickets to skilled agents
  3. Workload Balancing - Distributes tickets evenly
  4. Priority Handling - Ensures urgent tickets get attention
  5. Historical Performance - Learns from past assignments

OpenAI Configuration (5)

Routing Rules

php
'routing' => [
    'rules' => [
        'technical_issues' => [
            'target_department' => 'technical_support',
            'required_skills' => ['technical', 'troubleshooting'],
            'priority_boost' => 1.2,
        ],
        'billing_questions' => [
            'target_department' => 'billing',
            'required_skills' => ['billing', 'customer_service'],
            'priority_boost' => 1.0,
        ],
    ],
    'load_balancing' => true,
    'skill_matching' => true,
],

AI Usage Examples (5)

Automatic Assignment

php
// AI automatically assigns ticket to best agent
$assignment = $aiService->assignTicket($ticket);

// Example result:
[
    'assigned_agent' => 'john.doe@company.com',
    'confidence' => 0.87,
    'reasoning' => [
        'Technical expertise matches ticket requirements',
        'Current workload is manageable',
        'Historical performance with similar tickets is excellent',
    ],
    'estimated_resolution_time' => '2.5 hours',
]

AI Dashboard and Monitoring

Performance Metrics

The AI dashboard shows:

  1. Classification Accuracy - How often AI gets it right
  2. Response Quality - Rating of AI-generated responses
  3. Sentiment Trends - Customer satisfaction over time
  4. Prediction Accuracy - How well forecasts match reality
  5. Cost Analysis - AI usage and associated costs

Monitoring and Alerts

php
// Configure AI monitoring alerts
'monitoring' => [
    'alerts' => [
        'low_accuracy' => [
            'threshold' => 0.7,
            'action' => 'retrain_model',
        ],
        'high_costs' => [
            'threshold' => 100, // USD per day
            'action' => 'review_usage',
        ],
        'sentiment_drop' => [
            'threshold' => -0.3,
            'action' => 'investigate_issues',
        ],
    ],
],

Best Practices

1. Data Quality

  • Clean Data - Ensure ticket data is well-formatted
  • Consistent Categories - Use standardized category names
  • Regular Updates - Keep training data current

2. Gradual Implementation

  • Start Small - Begin with one AI feature
  • Monitor Performance - Track accuracy and user feedback
  • Expand Gradually - Add more features as confidence grows

3. Human Oversight

  • Review AI Decisions - Regularly check AI classifications
  • Provide Feedback - Correct mistakes to improve AI
  • Maintain Control - Always allow human override

4. Cost Management

  • Monitor Usage - Track API calls and costs
  • Optimize Queries - Use AI efficiently
  • Set Limits - Implement usage caps if needed

Troubleshooting

Troubleshooting Common Issues

API Connection Problems

bash
# Test OpenAI API connection
php artisan ai:test-connection

# Check API key validity
php artisan ai:validate-key

Low Classification Accuracy

  1. Review Training Data - Ensure quality historical data
  2. Adjust Thresholds - Lower confidence requirements
  3. Retrain Models - Update AI with recent data
  4. Manual Corrections - Provide feedback for improvement

High API Costs

  1. Optimize Queries - Reduce unnecessary API calls
  2. Cache Results - Store common responses
  3. Batch Processing - Process multiple items together
  4. Set Usage Limits - Implement daily/monthly caps

Getting Help

If you encounter issues with AI features:

  1. Check Logs - Review AI-related error logs
  2. Test Configuration - Verify API settings
  3. Contact Support - Reach out for assistance
  4. Review Documentation - Check OpenAI API docs

Next Steps

  1. Configure Email Piping for automatic ticket creation
  2. Set up Customization to tailor AI to your needs
  3. Explore API Integration for advanced AI features
  4. Review Troubleshooting Guide for common issues

AI Features transform your customer support from reactive to proactive, helping you deliver exceptional experiences while reducing workload and improving efficiency.

Released under the MIT License.