M2 self-improving analytics + OSS chatbot #1

Merged
kunthawat merged 3 commits from feature/m2-analytics-oss-chatbot into develop 2026-08-25 16:12:59 +07:00
Owner

M2 analytics (daily LLM classification, report dashboard, persona eval, approval flow) + OSS self-contained chatbot (guardrail + knowledge base). Push WIP batch after full independent review.

M2 analytics (daily LLM classification, report dashboard, persona eval, approval flow) + OSS self-contained chatbot (guardrail + knowledge base). Push WIP batch after full independent review.
kunthawat added 3 commits 2026-08-25 16:12:45 +07:00
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)
Built-in AI chatbot (no EE, uses Llm::Resolver) that answers in-scope chats
from a knowledge base and hands off to a human when needed. Selected per
inbox via an Integrations::Hook with app_id 'chatbot'.

- Integrations::Chatbot::ProcessorService (mirrors Dialogflow/Captain)
  wired via HookListener + HookJob + apps.yml(chatbot, inbox)
- Chatbot::DecisionService: 1-call default ({in_scope/refuse/handoff}),
  2-call option; thread-safe prompt threading
- Chatbot::KnowledgeRetriever: keyword top-k over KB (+ embedding reserved)
- KnowledgeBaseFaq + import service (md per-heading + front-matter tags)
- Chatbot::ConfigService + admin chatbot_config endpoint
- refs off-topic (e.g. fortune-telling); handoff = bot_handoff! (pending->open)
docs: session engineering log + handoff for M2 + OSS chatbot
Some checks failed
Auto-assign PR to Author / auto-assign (pull_request) Has been cancelled
Deploy Check / Check Deployment (pull_request) Has been cancelled
Frontend Lint & Test / test (pull_request) Has been cancelled
Log Lines Percentage Check / log_lines_check (pull_request) Has been cancelled
Run Chatwoot CE spec / lint-backend (pull_request) Has been cancelled
Run Chatwoot CE spec / security-scan (pull_request) Has been cancelled
Run Chatwoot CE spec / lint-frontend (pull_request) Has been cancelled
Run Chatwoot CE spec / frontend-tests (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (pull_request) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (pull_request) Has been cancelled
Run MFA Tests / test (pull_request) Has been cancelled
Run Size Limit Check / test (pull_request) Has been cancelled
Test Docker Build / test-build (linux/amd64, ubuntu-latest) (pull_request) Has been cancelled
Test Docker Build / test-build (linux/arm64, ubuntu-22.04-arm) (pull_request) Has been cancelled
Lint PR / Validate PR title (pull_request_target) Has been cancelled
fb55e08a9f
kunthawat merged commit cae92454e1 into develop 2026-08-25 16:12:59 +07:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kunthawat/moreminimore-chat#1