feat(analytics): M2 self-improving chatbot analytics

Daily LLM classification of every chat (topics + product tags + deal
won/lost/undecided) aggregated into immutable daily metrics, with a
filterable admin report dashboard, product-catalog import (text/CSV/XLSX),
weekly persona summary, and an approval flow (LINE -> Telegram -> webhook)
for applying persona recommendations.

- Llm::AnalyticsClassifier: per-account openai -> Captain fallback cascade
- AccountDailyProcessor + Conversation/CustomerDailyMetric aggregation
- ReportService + DrilldownService (summary + deep filterable drilldown)
- AnalyticsReports.vue + productCatalog import UI (admin-only)
- WeeklyPersonaEvaluator + PersonaApprovalService (LINE/Telegram/webhook)
- Weekly cron (Mon 10:00) + daily cron (02:30)
This commit is contained in:
Moreminimore
2026-08-25 15:56:11 +07:00
parent 02ae690a87
commit b86b0c59f6
22 changed files with 2095 additions and 0 deletions

View File

@@ -51,6 +51,8 @@ gem 'gmail_xoauth'
gem 'net-smtp', '~> 0.3.4'
# Prevent CSV injection
gem 'csv-safe'
# XLSX / ODS / XLS spreadsheet reading (used by Analytics::ProductCatalogImportService)
gem 'roo', '~> 2.10'
##-- for active storage --##
gem 'aws-sdk-s3', require: false