mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-29 19:12:15 +00:00
* FEATURE: add inferred concepts system This commit adds a new inferred concepts system that: - Creates a model for storing concept labels that can be applied to topics - Provides AI personas for finding new concepts and matching existing ones - Adds jobs for generating concepts from popular topics - Includes a scheduled job that automatically processes engaging topics * FEATURE: Extend inferred concepts to include posts * Adds support for concepts to be inferred from and applied to posts * Replaces daily task with one that handles both topics and posts * Adds database migration for posts_inferred_concepts join table * Updates PersonaContext to include inferred concepts Co-authored-by: Roman Rizzi <rizziromanalejandro@gmail.com> Co-authored-by: Keegan George <kgeorge13@gmail.com>
26 lines
613 B
Ruby
26 lines
613 B
Ruby
# frozen_string_literal: true
|
|
|
|
class InferredConcept < ActiveRecord::Base
|
|
has_many :inferred_concept_topics
|
|
has_many :topics, through: :inferred_concept_topics
|
|
|
|
has_many :inferred_concept_posts
|
|
has_many :posts, through: :inferred_concept_posts
|
|
|
|
validates :name, presence: true, uniqueness: true
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: inferred_concepts
|
|
#
|
|
# id :bigint not null, primary key
|
|
# name :string not null
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
#
|
|
# Indexes
|
|
#
|
|
# index_inferred_concepts_on_name (name) UNIQUE
|
|
#
|