# Discourse AI - Related topics

**URL:** https://meta.discourse.org/t/discourse-ai-related-topics/281807
**Category:** Site Management
**Tags:** how-to, ai, related-topics
**Created:** [October 10, 2023, 8:35pm UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807 "2023-10-10T20:35:51Z")
**Posts on this page:** 15
**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: [October 10, 2023, 8:35pm UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/1 "2023-10-10T20:35:51Z")

</div>

> 🔖 This guide explains how to enable and configure the Related topics feature of the [Discourse AI](https://meta.discourse.org/t/discourse-ai/259214) plugin.
> 
> 🙋 Required user level: Administrator

Related topics helps users discover relevant content by suggesting semantically similar topics based on the one they’re currently reading. This enhances content exploration and increases user engagement.

## Features

- Semantic textual similarity: Goes beyond keyword matching to find truly related content
- Toggle between “Suggested” and “Related” topics
- Available for both anonymous and logged-in users

## Enabling Related topics

> ℹ Related topics is turned on by default for all Discourse hosted customers with the Discourse AI plugin enabled

### Prerequisites

Related topics requires [Embeddings](https://meta.discourse.org/t/discourse-ai-embeddings/259603) to function.

If you are on our hosting, Embeddings is provided using an open-source model. No additional setup is required.

Self-hosted instances will need to configure an embedding model through a supported provider.

### Configuration

1. Go to Admin → Plugins → Discourse AI → AI Features
2. Find the **Embeddings** module and configure it:
  - Set `ai_embeddings_selected_model` to an embedding definition you have configured
  - Enable `ai_embeddings_enabled` to activate Embeddings

3. Enable `ai_embeddings_semantic_related_topics_enabled` to activate the Related Topics feature

### Setting up an embedding model

Before enabling embeddings, you need to configure an embedding model. Go to Admin → Plugins → Discourse AI → Embeddings to create a new embedding definition. You can choose from several presets:

- **Open AI** : `text-embedding-3-small` or `text-embedding-3-large` (recommended for most sites)
- **Google** : `gemini-embedding-001`
- **Hugging Face** (self-hosted inference): `multilingual-e5-large` (recommended for non-English or multilingual sites), `bge-large-en`, or `bge-m3`

You will need to provide an API key (or link an AI Secret) and endpoint URL for your chosen provider.

### Additional settings

The following settings let you fine-tune the Related Topics feature:

- `ai_embeddings_semantic_related_topics`: Maximum number of topics to show in the related topics section (default: 5)
- `ai_embeddings_semantic_related_include_closed_topics`: Whether to include closed topics in related results (default: true)
- `ai_embeddings_semantic_related_age_penalty`: Apply a penalty to older topics so newer content is preferred (default: 0.0, range: 0.0–2.0)
- `ai_embeddings_semantic_related_age_time_scale`: Time scale in days for the age penalty (default: 365)

## Technical FAQ

> **Expand to view a diagram of the Related topics architecture**
>
> The overview is, that when a topic is created / updated this happens:
> 
> ```mermaid
> sequenceDiagram
> User->>Discourse: Creates topic
> Discourse-->>Embedding Microservice: Generates embeddings
> Embedding Microservice-->>Discourse: 
> Discourse-->>PostgreSQL:Store Embeddings 
> 
> ```
> 
> And during topic visit:
> 
> ```mermaid
> sequenceDiagram
> User->>Discourse: Visits topic
> Discourse-->>PostgreSQL: Query closest topics
> PostgreSQL-->>Discourse: 
> Discourse->>User: Presents related topics 
> 
> ```

**How does Related topics work?**

- When a user visits a topic, Discourse queries the database for the most semantically similar topics based on their embedded representations. These related topics are then presented to the user, encouraging further exploration of the community’s content.

**How is topic/post data processed?**

- For Discourse-hosted sites, data is processed within our secure virtual private datacenter. For self-hosted sites, data processing depends on your chosen third-party provider.

**Where is the embeddings data stored?**

- Embeddings data is stored in your Discourse database, alongside other forum data like topics, posts, and users.

**What embedding models are available?**

- Discourse AI supports models from OpenAI (`text-embedding-3-small`, `text-embedding-3-large`), Google (`gemini-embedding-001`), Hugging Face-compatible endpoints (`bge-large-en`, `bge-m3`, `multilingual-e5-large`), and Cloudflare Workers AI. You can also configure custom embedding models through the admin UI.

> Last edited by @Saif 2024-11-04T18:08:05Z
> 
> Last checked by @hugh 2024-08-06T04:30:59Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://meta.discourse.org/u/EricGT)
#### Post date: [December 16, 2023, 3:04pm UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/9 "2023-12-16T15:04:57Z")

</div>

Something worth keeping an eye on.

In reviewing many post in Related Topics for an English site (OpenAI) starting to notice that topics in Spanish tend to be grouped together and suspect that if they were first translated to English each post would have a different vector and thus be clustered with other post. 🙂

* * *

* * *

A side benefit of this feature for moderators is to check that the categories of the topics listed in Related Topics are correct.

As I review each new post I also check the Related Topics. This is becoming an effective way to identify topics created with the wrong category.

FYI - A related idea was noted in this feature request.

> [@Have the AI read the first post of a topic](https://meta.discourse.org/t/have-the-ai-read-the-first-post-of-a-topic/275768):
>
> Suggestion Have the AI read the first post of a topic to make sure It is coherent The category and the tags agree. (I know this can be configured but why not let the AI do it) The content of the post agrees with the category and tags. The content of the post agrees with the title of the post. It is relevant to the forum. (I know spam detectors will catch some of this but sometimes it is not spam and just doesn’t belong) Users may not use the correct category and/or tags and then ask a quest…

* * *

* * *

Find this topic when often needing following link which is not so easy to find so noting here.

> [@Discourse AI - Related Topics: Enhancing Content Exploration](https://meta.discourse.org/t/discourse-ai-related-topics-enhancing-content-exploration/288732):
>
> At Discourse we are always working to elevate your community experience.&nbsp; Our Discourse AI modules are designed to make both the management and member experience of your community easier, simpler, faster, and hopefully, more fun. This is a companion discussion topic for the original entry at [https://blog.discourse.org/2023/12/ai-related-topics-enhancing-content-exploration](https://blog.discourse.org/2023/12/ai-related-topics-enhancing-content-exploration)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 17, 2023, 4:52pm UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/10 "2023-12-17T16:52:21Z")

</div>

> [@EricGT](#):
>
> Something worth keeping an eye on.
> 
> In reviewing many post in Related Topics for an English site (OpenAI) starting to notice that topics in Spanish tend to be grouped together and suspect that if they were first translated to English each post would have a different vector and thus be clustered with other post. 🙂

That behavior is governed by the model, and it appears to be a know problem:

> **[Does ada support other languages than English?](https://community.openai.com/t/does-ada-support-other-languages-than-english/185307/3)**
>
> We did a huge embedded database using French, English, German, Spanish and Portuguese for an academic research paper. The embedding worked well in multiple languages However, we kept track of the source language for each piece of text we...

I think the OSS model we recommend for multilingual sites does a better job at this, but we still need to rollout it to more customers to validate this.

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [February 13, 2024, 4:06pm UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/13 "2024-02-13T16:06:14Z")

</div>

> [@Saif](#):
>
> - Enable `ai_embeddings_enabled` for the Embeddings module needed for Related Topics feature

It won’t let me enable this option:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/9/7/697a72247a6ebf71cab3126f1173a82c255e79ac.png)

~~Am I missing something here or is Gemini alone not enough?~~

UPDATE: The instructions and error description may want to be updated to add that the `ai embeddings model` should also be updated to match the provider otherwise `ai_embeddings_enabled` can’t be enabled. The parameter description is missing Gemini as an option.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 27, 2024, 7:57pm UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/15 "2024-02-27T19:57:43Z")

</div>

7 posts were split to a new topic: [“Net::HTTPBadResponse” errors on Gemini Embeddings](https://meta.discourse.org/t/net-httpbadresponse-errors-on-gemini-embeddings/296952)

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [March 9, 2024, 10:49am UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/16 "2024-03-09T10:49:05Z")

</div>

What do I fill here pls:

 ![The image shows a user interface of an application settings page related to API keys, with a focus on a field for a 'discourse_service_api_key' which seems to be tied to an embeddings API. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/4/c/5/4c5e556d0e7046fb2d2c8a8397c8b70fe2ea3047.png)

I want to fill the above, because I want to enable the first option among the 4 shown below:

 ![The image displays a webpage settings panel with various options related to AI embeddings and semantic search functions, all appearing to be enabled. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/2/6/2/26206873ac0104b90bd77cd521c0ab9ddda7c350.png)

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 9, 2024, 11:03am UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/17 "2024-03-09T11:03:29Z")

</div>

> [@Bathinda](#):
>
> What do I fill here pls

If you use OpenAI, nothing.

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [March 9, 2024, 11:45am UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/19 "2024-03-09T11:45:17Z")

</div>

Then this 1st option (Embeddings Module) troubles me, doesn’t let me enable it:

 ![26206873ac0104b90bd77cd521c0ab9ddda7c350](https://global.discourse-cdn.com/meta/original/4X/d/5/f/d5fa84560e345b652d433482228e3c8102b77aff.png)

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 9, 2024, 11:57am UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/20 "2024-03-09T11:57:53Z")

</div>

Most of those are empty. But `ai embeddings discourse service api key` is your OpenAI API and `ai embeddings discourse service api endpoint` is `https://api.openai.com/v1/embeddings`. Model should be `text-embedding-3-large` (sure, it can be `small` too but it has some issues).

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [April 24, 2024, 7:50am UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/21 "2024-04-24T07:50:09Z")

</div>

3 posts were split to a new topic: [How to get both Suggested and Related topics to display](https://meta.discourse.org/t/how-to-get-both-suggested-and-related-topics-to-display/305206)

---

<div class="post-metadata">

### Author: ![Overgrow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/overgrow/32/478189_2.png) [@Overgrow](https://meta.discourse.org/u/Overgrow)
#### Post date: [September 11, 2024, 8:17am UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/22 "2024-09-11T08:17:16Z")

</div>

> [@Jagster](#):
>
> Model should be `text-embedding-3-large` (sure, it can be `small` too but it has some issues).

What were your results from comparing `small` and `large`? I know there is a difference in dimensions that affects the model’s precision. The `small` version is 5x cheaper. Is it really unusable in the real world for topic similarity? Our forum is 99% English.

> [@Falco](#):
>
> I think the OSS model we recommend for multilingual sites does a better job at this

I’d be very interested in hearing more. Can you please elaborate on where [all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2) sits in comparison to OpenAI models for a purely English site?

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [September 11, 2024, 9:12am UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/23 "2024-09-11T09:12:13Z")

</div>

Embeddings are so cheap that price doesn’t matter — unless there is myriad posts when 0.01 cents matter in total costs.

But honestly… I didn’t see any differences. And for me, because there is chance I can’t use RAG and embeds properly, both are equal useless. i know that is badly against public opinion, but on my site that system just doesn’t find and use anything useful.

Propably it comes from OpenAI-models but I don’t have enough money to use those more professional solutions.

---

<div class="post-metadata">

### Author: ![haydenjames](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haydenjames/32/255678_2.png) [@haydenjames](https://meta.discourse.org/u/haydenjames)
#### Post date: [August 29, 2025, 7:01pm UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/24 "2025-08-29T19:01:04Z")

</div>

> [@Discourse](#):
>
> For OpenAI or Azure OpenAI:  
> Set `ai embeddings model` to `text-embedding-ada-002`

I’ve been using the **text-embedding-3-small** model before I read this. Is the text-embedding-ada-002 a lot better?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 29, 2025, 11:21pm UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/25 "2025-08-29T23:21:09Z")

</div>

Ada is previous generation

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 25, 2026, 11:37pm UTC](https://meta.discourse.org/t/discourse-ai-related-topics/281807/26 "2026-01-25T23:37:51Z")

</div>

A post was split to a new topic: [Related Topics not translated](https://meta.discourse.org/t/related-topics-not-translated/394305)
