Go to file
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
.github/workflows Initial commit 2023-02-17 11:33:47 -03:00
admin/assets/javascripts/discourse FEATURE: Add AI-powered spam detection for new user posts (#1004) 2024-12-12 09:17:25 +11:00
app FEATURE: Add AI-powered spam detection for new user posts (#1004) 2024-12-12 09:17:25 +11:00
assets FEATURE: Add AI-powered spam detection for new user posts (#1004) 2024-12-12 09:17:25 +11:00
config FEATURE: Add AI-powered spam detection for new user posts (#1004) 2024-12-12 09:17:25 +11:00
db FEATURE: Add AI-powered spam detection for new user posts (#1004) 2024-12-12 09:17:25 +11:00
discourse_automation FEATURE: Select stop sequences from triage script (#1010) 2024-12-06 11:13:47 -03:00
lib FEATURE: Add AI-powered spam detection for new user posts (#1004) 2024-12-12 09:17:25 +11:00
public/ai-share UX: improve artifact styling add direct share link (#930) 2024-11-20 13:13:03 +11:00
spec FEATURE: Add AI-powered spam detection for new user posts (#1004) 2024-12-12 09:17:25 +11:00
svg-icons UX: update gist toggle styles (#926) 2024-11-19 15:33:34 -05:00
test/javascripts DEV: Improve explain suggestion footnote replacement (#999) 2024-12-04 11:41:34 -08:00
tokenizers FEATURE: Set endpoint credentials directly from LlmModel. (#625) 2024-05-16 09:50:22 -03:00
.discourse-compatibility DEV: `IMAGE_MARKDOWN_REGEX` import available in core (#847) 2024-10-21 14:48:10 -07:00
.gitignore FEATURE: Discord Bot integration (#831) 2024-10-16 12:41:18 -03:00
.npmrc DEV: Switch to use pnpm (#833) 2024-10-14 13:37:20 +02:00
.prettierignore FEATURE: UI to update ai personas on admin page (#290) 2023-11-21 16:56:43 +11:00
.prettierrc.cjs DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.rubocop.yml DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.streerc DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.template-lintrc.cjs DEV: Update linting (#326) 2023-11-29 23:01:48 +01:00
Gemfile DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
Gemfile.lock Build(deps-dev): Bump rexml from 3.3.6 to 3.3.9 (#874) 2024-10-28 20:44:39 +01:00
LICENSE Initial commit 2023-02-17 11:33:47 -03:00
README.md CHORE: Update Readme (#185) 2023-09-04 15:46:35 -03:00
eslint.config.mjs DEV: Update eslint config (#917) 2024-11-19 11:57:40 +01:00
package.json DEV: Update linting (#974) 2024-11-28 16:07:42 +01:00
plugin.rb FEATURE: Add AI-powered spam detection for new user posts (#1004) 2024-12-12 09:17:25 +11:00
pnpm-lock.yaml DEV: Update linting (#974) 2024-11-28 16:07:42 +01:00
translator.yml UX: Display the indexing progress for RAG uploads (#557) 2024-04-09 11:03:07 -03:00

README.md

Discourse AI Plugin

Plugin Summary

For more information, please see: https://meta.discourse.org/t/discourse-ai/259214?u=falco