discourse-ai/admin/assets/javascripts/discourse/routes
Sam 47f5da7e42
FEATURE: Add AI-powered spam detection for new user posts (#1004)
This introduces a comprehensive spam detection system that uses LLM models
to automatically identify and flag potential spam posts. The system is
designed to be both powerful and configurable while preventing false positives.

Key Features:
* Automatically scans first 3 posts from new users (TL0/TL1)
* Creates dedicated AI flagging user to distinguish from system flags
* Tracks false positives/negatives for quality monitoring
* Supports custom instructions to fine-tune detection
* Includes test interface for trying detection on any post

Technical Implementation:
* New database tables:
  - ai_spam_logs: Stores scan history and results
  - ai_moderation_settings: Stores LLM config and custom instructions
* Rate limiting and safeguards:
  - Minimum 10-minute delay between rescans
  - Only scans significant edits (>10 char difference)
  - Maximum 3 scans per post
  - 24-hour maximum age for scannable posts
* Admin UI features:
  - Real-time testing capabilities
  - 7-day statistics dashboard
  - Configurable LLM model selection
  - Custom instruction support

Security and Performance:
* Respects trust levels - only scans TL0/TL1 users
* Skips private messages entirely
* Stops scanning users after 3 successful public posts
* Includes comprehensive test coverage
* Maintains audit log of all scan attempts


---------

Co-authored-by: Keegan George <kgeorge13@gmail.com>
Co-authored-by: Martin Brennan <martin@discourse.org>
2024-12-12 09:17:25 +11:00
..
admin-plugins-show-discourse-ai-llms-new.js DEV: Convert to native class syntax (#981) 2024-11-29 16:41:09 +01:00
admin-plugins-show-discourse-ai-llms-show.js DEV: Convert to native class syntax (#981) 2024-11-29 16:41:09 +01:00
admin-plugins-show-discourse-ai-llms.js FEATURE: Configurable LLMs. (#606) 2024-05-13 12:46:42 -03:00
admin-plugins-show-discourse-ai-personas-new.js DEV: Convert to native class syntax (#981) 2024-11-29 16:41:09 +01:00
admin-plugins-show-discourse-ai-personas-show.js DEV: Convert to native class syntax (#981) 2024-11-29 16:41:09 +01:00
admin-plugins-show-discourse-ai-personas.js DEV: Moving around admin persona config routes again (#586) 2024-05-02 12:42:30 +10:00
admin-plugins-show-discourse-ai-spam.js FEATURE: Add AI-powered spam detection for new user posts (#1004) 2024-12-12 09:17:25 +11:00
admin-plugins-show-discourse-ai-tools-new.js DEV: Clean up after #677 (#694) 2024-06-28 08:59:51 +10:00
admin-plugins-show-discourse-ai-tools-show.js DEV: Clean up after #677 (#694) 2024-06-28 08:59:51 +10:00
admin-plugins-show-discourse-ai-tools.js DEV: Clean up after #677 (#694) 2024-06-28 08:59:51 +10:00
admin-plugins-show-discourse-ai-usage.js FEATURE: AI Usage page (#964) 2024-11-29 06:26:48 +11:00