{
  "_ai_metadata": {
    "models_used": {
      "per_feedback_summarization": {
        "model": "@cf/facebook/bart-large-cnn",
        "purpose": "Generates concise summaries for each feedback item",
        "usage": "Called once per feedback during analysis"
      },
      "aggregate_executive_summary": {
        "model": "@cf/meta/llama-3.1-8b-instruct",
        "purpose": "Synthesizes PM-style executive summary from aggregated insights",
        "usage": "Called once per /api/insights request over pre-aggregated SQL data"
      }
    },
    "classification_method": "rule-based",
    "classification_fields": [
      "theme",
      "sentiment",
      "urgency",
      "value",
      "key_phrases"
    ],
    "ai_architecture": "BART for summaries + Rules for classification + Llama for executive narrative"
  },
  "generated_at": "2026-04-07T09:13:58.958Z",
  "ai_executive_summary": {
    "content": "Here's a concise executive summary:\n\nThis week's feedback data highlights critical issues affecting 4 customers and 3 high-value unhappy customers, primarily due to mobile app crashes on Android 14 and password reset email delivery issues. We must prioritize resolving these critical bugs and addressing the top-voted request for Dark mode support (156 votes) to improve customer satisfaction. I recommend allocating resources to fix these issues and provide a roadmap for implementation.",
    "model": "@cf/meta/llama-3.1-8b-instruct",
    "generated_at": "2026-04-07T09:13:58.958Z",
    "ai_powered": true,
    "fallback_used": false,
    "note": "AI-generated executive summary for leadership"
  },
  "executive_summary": {
    "total_feedback": 15,
    "critical_issues": 4,
    "awaiting_review": 3,
    "high_value_unhappy_customers": 6,
    "sentiment_trend": "stable"
  },
  "insights": {
    "urgent_themes_this_week": {
      "question": "What themes are most urgent this week?",
      "answer": "No urgent themes this week",
      "data": []
    },
    "high_value_negative_feedback": {
      "question": "What high-value feedback has negative sentiment?",
      "answer": "6 high-value customers are unhappy",
      "data": [
        {
          "ticket": "T264815",
          "title": "Mobile app crashes on Android 14",
          "customer": "BugHunter99",
          "votes": 67,
          "theme": "bug",
          "urgency": "critical",
          "suggested_action": "Investigate and fix Android 14 compatibility issue",
          "sentiment_score": -0.8
        },
        {
          "ticket": "T158374",
          "title": "API documentation is outdated",
          "customer": "@techdev_sam",
          "votes": 45,
          "theme": "documentation",
          "urgency": "high",
          "suggested_action": "Update API documentation urgently",
          "sentiment_score": -0.7
        },
        {
          "ticket": "T426183",
          "title": "Performance degradation after last update",
          "customer": "QA_Team",
          "votes": 34,
          "theme": "performance",
          "urgency": "high",
          "suggested_action": "Profile recent changes to identify regression",
          "sentiment_score": -0.6
        },
        {
          "ticket": "T847291",
          "title": "Dashboard loading is too slow on mobile devices",
          "customer": "John Smith",
          "votes": 24,
          "theme": "performance",
          "urgency": "high",
          "suggested_action": "Profile and optimize mobile performance",
          "sentiment_score": -0.6
        },
        {
          "ticket": "T374926",
          "title": "Security concern: Session timeout too long",
          "customer": "IT Security Team",
          "votes": 8,
          "theme": "security",
          "urgency": "critical",
          "suggested_action": "Review security implications and prioritize fix",
          "sentiment_score": -0.5
        },
        {
          "ticket": "T917364",
          "title": "Password reset email never arrives",
          "customer": "@locked_out",
          "votes": 4,
          "theme": "bug",
          "urgency": "critical",
          "suggested_action": "Investigate email delivery issues urgently",
          "sentiment_score": -0.9
        }
      ]
    },
    "top_voted_unresolved": {
      "question": "What are the most voted-on unresolved issues?",
      "answer": "Top issue: \"Request: Dark mode support\" with 156 votes",
      "data": [
        {
          "ticket": "T629481",
          "title": "Request: Dark mode support",
          "votes": 156,
          "theme": "ux",
          "urgency": "medium",
          "status": "planned",
          "suggested_action": "Add to UX roadmap for dark mode implementation"
        },
        {
          "ticket": "T642918",
          "title": "Two-factor authentication request",
          "votes": 93,
          "theme": "security",
          "urgency": "high",
          "status": "in-progress",
          "suggested_action": "Implement 2FA for compliance requirements"
        },
        {
          "ticket": "T516284",
          "title": "Integration with Salesforce needed",
          "votes": 89,
          "theme": "integration",
          "urgency": "critical",
          "status": "planned",
          "suggested_action": "Prioritize Salesforce integration for enterprise retention"
        },
        {
          "ticket": "T718294",
          "title": "Would like bulk actions in the UI",
          "votes": 78,
          "theme": "ux",
          "urgency": "medium",
          "status": "new",
          "suggested_action": "Add bulk actions to improve efficiency"
        },
        {
          "ticket": "T264815",
          "title": "Mobile app crashes on Android 14",
          "votes": 67,
          "theme": "bug",
          "urgency": "critical",
          "status": "in-progress",
          "suggested_action": "Investigate and fix Android 14 compatibility issue"
        },
        {
          "ticket": "T648291",
          "title": "Notification overload",
          "votes": 58,
          "theme": "ux",
          "urgency": "medium",
          "status": "new",
          "suggested_action": "Improve notification preferences UI"
        },
        {
          "ticket": "T593847",
          "title": "Webhook retry mechanism needed",
          "votes": 52,
          "theme": "integration",
          "urgency": "high",
          "status": "planned",
          "suggested_action": "Implement webhook retry mechanism"
        },
        {
          "ticket": "T158374",
          "title": "API documentation is outdated",
          "votes": 45,
          "theme": "documentation",
          "urgency": "high",
          "status": "in-progress",
          "suggested_action": "Update API documentation urgently"
        },
        {
          "ticket": "T426183",
          "title": "Performance degradation after last update",
          "votes": 34,
          "theme": "performance",
          "urgency": "high",
          "status": "in-review",
          "suggested_action": "Profile recent changes to identify regression"
        },
        {
          "ticket": "T482615",
          "title": "Pricing tier confusion",
          "votes": 31,
          "theme": "pricing",
          "urgency": "medium",
          "status": "new",
          "suggested_action": "Review with product/sales team to clarify pricing"
        }
      ]
    },
    "sentiment_trend": {
      "question": "Is customer sentiment improving or declining?",
      "answer": "Not enough data for trend",
      "data": []
    },
    "critical_bugs": {
      "question": "What bugs need immediate attention?",
      "answer": "3 critical/high bugs need attention",
      "data": [
        {
          "ticket": "T264815",
          "title": "Mobile app crashes on Android 14",
          "customer": "BugHunter99",
          "votes": 67,
          "urgency": "critical",
          "status": "in-progress",
          "suggested_action": "Investigate and fix Android 14 compatibility issue"
        },
        {
          "ticket": "T917364",
          "title": "Password reset email never arrives",
          "customer": "@locked_out",
          "votes": 4,
          "urgency": "critical",
          "status": "in-progress",
          "suggested_action": "Investigate email delivery issues urgently"
        },
        {
          "ticket": "T739162",
          "title": "Bug: Charts not rendering correctly in Firefox",
          "customer": "DevUser42",
          "votes": 15,
          "urgency": "high",
          "status": "in-review",
          "suggested_action": "Investigate Firefox-specific rendering issue"
        }
      ]
    },
    "integration_requests": {
      "question": "What integrations are customers asking for?",
      "answer": "Top request: Integration with Salesforce needed",
      "data": [
        {
          "ticket": "T516284",
          "title": "Integration with Salesforce needed",
          "votes": 89,
          "urgency": "critical",
          "value": "high",
          "key_phrases": [
            "Salesforce",
            "integration",
            "enterprise",
            "deal-breaker"
          ]
        },
        {
          "ticket": "T593847",
          "title": "Webhook retry mechanism needed",
          "votes": 52,
          "urgency": "high",
          "value": "high",
          "key_phrases": [
            "webhook",
            "retry",
            "events",
            "backoff"
          ]
        }
      ]
    },
    "quick_wins": {
      "question": "What are easy wins we can tackle quickly?",
      "answer": "3 potential quick wins identified",
      "data": [
        {
          "ticket": "T718294",
          "title": "Would like bulk actions in the UI",
          "votes": 78,
          "theme": "ux",
          "suggested_action": "Add bulk actions to improve efficiency"
        },
        {
          "ticket": "T648291",
          "title": "Notification overload",
          "votes": 58,
          "theme": "ux",
          "suggested_action": "Improve notification preferences UI"
        },
        {
          "ticket": "T482615",
          "title": "Pricing tier confusion",
          "votes": 31,
          "theme": "pricing",
          "suggested_action": "Review with product/sales team to clarify pricing"
        }
      ]
    },
    "security_concerns": {
      "question": "Are there any security concerns to address?",
      "answer": "2 security-related feedback items",
      "data": [
        {
          "ticket": "T374926",
          "title": "Security concern: Session timeout too long",
          "customer": "IT Security Team",
          "urgency": "critical",
          "status": "in-review",
          "suggested_action": "Review security implications and prioritize fix"
        },
        {
          "ticket": "T642918",
          "title": "Two-factor authentication request",
          "customer": "Compliance Officer",
          "urgency": "high",
          "status": "in-progress",
          "suggested_action": "Implement 2FA for compliance requirements"
        }
      ]
    }
  },
  "ai_analysis_samples": {
    "description": "Sample feedback items showing AI-powered analysis (BART summarization + rule-based classification)",
    "model": "@cf/facebook/bart-large-cnn",
    "samples": [
      {
        "ticket": "T158374",
        "original_title": "API documentation is outdated",
        "original_content": "The API docs for the /users endpoint show v1 syntax but v2 has different parameters. This cost us 2 days of debugging. Please update!",
        "ai_analysis": {
          "summary": "API documentation for /users endpoint shows outdated v1 syntax, causing 2 days of debugging time for user.",
          "theme": "documentation",
          "sentiment": "negative",
          "sentiment_score": -0.7,
          "urgency": "high",
          "value": "high",
          "key_phrases": [
            "API",
            "documentation",
            "outdated",
            "debugging"
          ],
          "suggested_action": "Update API documentation urgently"
        },
        "analyzed_by": "bart+rules"
      },
      {
        "ticket": "T739162",
        "original_title": "Bug: Charts not rendering correctly in Firefox",
        "original_content": "When using Firefox 125, the analytics charts overlap with the sidebar. Chrome and Safari work fine. Attached screenshots showing the issue.",
        "ai_analysis": {
          "summary": "Firefox 125 rendering bug causes analytics charts to overlap with sidebar; Chrome and Safari unaffected.",
          "theme": "bug",
          "sentiment": "negative",
          "sentiment_score": -0.4,
          "urgency": "high",
          "value": "medium",
          "key_phrases": [
            "Firefox",
            "charts",
            "overlap",
            "bug"
          ],
          "suggested_action": "Investigate Firefox-specific rendering issue"
        },
        "analyzed_by": "bart+rules"
      },
      {
        "ticket": "T593847",
        "original_title": "Webhook retry mechanism needed",
        "original_content": "When our server is temporarily down, webhook events are lost. Need a retry mechanism with exponential backoff.",
        "ai_analysis": {
          "summary": "Request for webhook retry mechanism with exponential backoff to prevent event loss during server downtime.",
          "theme": "integration",
          "sentiment": "neutral",
          "sentiment_score": 0,
          "urgency": "high",
          "value": "high",
          "key_phrases": [
            "webhook",
            "retry",
            "events",
            "backoff"
          ],
          "suggested_action": "Implement webhook retry mechanism"
        },
        "analyzed_by": "bart+rules"
      }
    ]
  }
}