discourse/plugins/discourse-ai/spec/configuration
Natalie Tay 8cf0637583
DEV: Add the ability to register an AI module for data explorer (#38891)
Right now, AI modules and features are hardcoded in
`Configuration::Feature` and `Configuration::Module`. If another plugin
wants to register an AI-powered feature (with its own agent, LLM config,
and a spot on the AI features admin page), there's no way to do it
without modifying discourse-ai directly.

Data explorer needs a query generation agent, and other plugins will be
able to add their own agents too. So we need a proper extensible API
here.

The consumer code ends up looking like this:

```
  DiscoursePluginRegistry.register_external_ai_feature(
    {
      module_name: :data_explorer,
      feature: :query_generation,
      agent_klass: DiscourseDataExplorer::AiQueryGenerator,
      enabled_by_setting: "data_explorer_ai_queries_enabled",
    },
    self,
  )
```

<img width="658" height="258" alt="Screenshot 2026-03-26 at 2 25 19 PM"
src="https://github.com/user-attachments/assets/9239b903-78a5-4e8b-9bf0-e385a030920b"
/>

---------

Co-authored-by: Roman Rizzi <rizziromanalejandro@gmail.com>
2026-04-03 13:59:06 +08:00
..
embedding_defs_validator_spec.rb DEV: Only run embeddings test if there's a valid embedding model (#34525) 2025-08-25 17:21:39 -03:00
feature_register_spec.rb DEV: Add the ability to register an AI module for data explorer (#38891) 2026-04-03 13:59:06 +08:00
feature_spec.rb DEV: AI persona to agent migration (#38319) 2026-03-10 15:59:45 +11:00
llm_enumerator_spec.rb DEV: AI persona to agent migration (#38319) 2026-03-10 15:59:45 +11:00
llm_validator_spec.rb FEATURE: configure a default LLM model for all features (#33752) 2025-07-28 16:08:00 -03:00
module_register_spec.rb DEV: Add the ability to register an AI module for data explorer (#38891) 2026-04-03 13:59:06 +08:00
spam_detection_validator_spec.rb