# Auto-categorize topics using AI

**URL:** https://meta.discourse.org/t/auto-categorize-topics-using-ai/401827
**Category:** Site Management
**Tags:** automation, how-to, ai
**Created:** [May 1, 2026, 1:04am UTC](https://meta.discourse.org/t/auto-categorize-topics-using-ai/401827 "2026-05-01T01:04:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [May 1, 2026, 1:04am UTC](https://meta.discourse.org/t/auto-categorize-topics-using-ai/401827/1 "2026-05-01T01:04:07Z")

</div>

> 🔖 This guide explains how to automatically categorize topics using the AI triage feature in the [Discourse AI](https://meta.discourse.org/t/discourse-ai/259214) plugin combined with [Discourse Automation](https://meta.discourse.org/t/discourse-automation/195773).
> 
> 🙋 Required user level: Administrator

## Auto-categorize topics using AI

This automation uses an LLM to read topic content, decides whether the selected category is appropriate, and updates it if the AI Agent considers another category suits the topic better.

### Prerequisites

- The [Discourse AI](https://meta.discourse.org/t/discourse-ai/259214) and the [Discourse Automation](https://meta.discourse.org/t/discourse-automation/195773) plugins must be enabled.
- At least one LLM must be configured. See the [LLM settings guide](https://meta.discourse.org/t/discourse-ai-large-language-model-llm-settings-page/319903) for setup instructions.
- An [Agent](https://meta.discourse.org/t/ai-bot-personas/306099) must be configured with a suitable system prompt.

### Reference Agent configurations

- System prompt:

```plaintext
You are an expert content classifier for this forum.

  Your task is to analyze posts and suggest the appropriate category based on content, images, and the list of categories available.

  Guidelines:
  - Be conservative - only categorize what you're confident about
  - Consider both content topic and post intent

```

- Default language model: Select the LLM configured in the Prerequisites section.

> 🗒 Discourse hosted customers can select the CDCK Hosted Small LLM when configuring AI Agents.

- Enabled tools: Read, Categories, Edit Categories
- Forced tools: Read, Categories
- Forced tools strategy: Apply to first reply only
- Execution Mode: Default (Fixed Limits)
- (Optional) Turn on the Require approval for moderation tools option
- User: Create user

### Automation configurations

1. Navigate to **Admin** → **Plugins** → **Automations**.
2. Click **+ Add Automation**.
3. Select the **Triage posts using AI Agent** script.
4. Configure the settings from the When/What section as you see fit.
5. Select the Agent defined for this automation in the `AI Agent` setting from the Script options section.
6. Enable the `Silent Mode` setting.
7. Click on the Update automation button.
8. Enable the automation.

 ![Script options](https://global.discourse-cdn.com/meta/original/4X/b/9/5/b95c109906f30c06758684d33fde2142f21fe7b3.png)

## Best practices

- **Start with a narrow scope:** Apply the automation only to a specific category or to first posts by new users (trust level 0 or 1) before expanding it. This limits LLM costs and reduces the risk of widespread mis-categorizing.
- **Write clear category descriptions in your prompt:** The more precise your descriptions of each category’s meaning, the more reliably the LLM will classify correctly.
- **Monitor for false positives and negatives:** The LLM won’t be 100% accurate. Build a workflow for reviewing and correcting mis-categorized topics, and adjust your prompt over time.
- **Keep token limits sensible:** The “Max Post Tokens” setting limits how much of a post is sent to the LLM. For most auto-categorizing tasks, the first few hundred tokens (the opening of the post) is sufficient.

## Common issues and solutions

- **The appropriate category is not being applied by the automation**  
Review the security settings of the category. If the category that should be applied is a private category, make sure the `Read private` tool option from the Agent settings is enabled.
- **The automation runs but doesn’t categorize topics**  
Review the site’s logs to identify any errors associated with the Discourse AI or Discourse Automation plugins.

## Additional resources

- [Discourse AI - AI triage](https://meta.discourse.org/t/discourse-ai-ai-triage/281227)
- [Discourse Automation](https://meta.discourse.org/t/discourse-automation/195773)
- [Discourse AI - Large Language Model (LLM) settings page](https://meta.discourse.org/t/discourse-ai-large-language-model-llm-settings-page/319903)
- [AI bot - Agents](https://meta.discourse.org/t/ai-bot-personas/306099)
- [Tag topics using AI](https://meta.discourse.org/t/tag-topics-using-ai/401178)
