discourse/plugins/discourse-ai/lib
Rafael dos Santos Silva 281d0c3e11
FEATURE: add configurable age penalty for semantic related topics (#34842)
Introduces two new site settings to apply exponential age-based
penalties to semantic topic suggestions, similar to algorithms
used by Reddit/HN:

* ai_embeddings_semantic_related_age_penalty (default: 0.3)
  Controls penalty strength. 0.0 = disabled, 0.3 = gentle bias
  toward newer content, 1.0+ = strong recency preference

* ai_embeddings_semantic_related_age_time_scale (default: 365 days)
  Controls time horizon. Use 365 for yearly scale, 90 for
  quarterly scale, etc.

Formula: similarity_score / POWER(age_in_days / time_scale + 1, penalty)

This allows sites to de-prioritize older topics in suggestions
while maintaining configurability for forums with different
content lifecycles. Performance optimized with conditional
JOINs only when penalty > 0.


"Age" here is using bumped_at to work with communities with long
lived mega topics too.

---------

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2025-09-18 10:24:19 -03:00
..
ai_bot FEATURE: improvements to ai conversation page (#33853) 2025-07-26 09:19:28 +10:00
ai_helper FEATURE: Use a persona when running the AI triage automation script (#34010) 2025-08-04 09:11:13 -03:00
ai_moderation FEATURE: Skip spam scanning when relevant content is unchanged or edited by staff (#34391) 2025-08-19 09:04:02 +10:00
automation FIX: Ensure base_path is correctly inserted into LLM triage messages. (#34778) 2025-09-11 11:21:06 +10:00
completions FEATURE: add support for google image model (#34570) 2025-08-29 14:39:37 +10:00
configuration DEV: Only run embeddings test if there's a valid embedding model (#34525) 2025-08-25 17:21:39 -03:00
database
discord/bot
embeddings FEATURE: add configurable age penalty for semantic related topics (#34842) 2025-09-18 10:24:19 -03:00
inference FEATURE: Add support for matryoshka in Gemini embeddings (#34145) 2025-08-07 15:35:08 -03:00
inferred_concepts
personas FIX: Default prompts have to be explicit about the expected format. (#34442) 2025-08-20 13:56:21 -03:00
sentiment
summarization DEV: Pass category/tags to LLM for AI summary (#33861) 2025-07-25 10:35:05 -05:00
tasks FIX: Helper rake task typo in llm setting (#34057) 2025-08-04 16:23:17 +08:00
translation FIX: Do not send empty content when detecting language (#34825) 2025-09-17 00:52:40 +08:00
utils
automation.rb FEATURE: Add option to flag + delete for llm triage (#34590) 2025-09-02 09:16:30 +10:00
embeddings.rb
engine.rb
guardian_extensions.rb FEATURE: Ability to regenerate short summaries (#34345) 2025-08-18 13:48:41 -07:00
multisite_hash.rb
post_extensions.rb
summarization.rb FEATURE: Use a persona when running the AI triage automation script (#34010) 2025-08-04 09:11:13 -03:00
topic_extensions.rb
translation.rb FEATURE: configure a default LLM model for all features (#33752) 2025-07-28 16:08:00 -03:00