Discourse AI

:discourse2: Summary Integration between AI features and Discourse
:hammer_and_wrench: Repository Link GitHub - discourse/discourse-ai
:open_book: Install Guide How to install plugins in Discourse

Please check our blog post about this plugin at

Introducing Discourse AI

We are happy to announce a brand new Discourse plugin that we have been working on: Discourse AI.

Discourse AI is our one-stop solution for integrating Artificial Intelligence and Discourse, enabling both new features and enhancing existing ones. With this first release, we are shipping 5 different Discourse AI modules.

Discourse AI Modules

For Discourse AI, we have opted to keep its features all in a single plugin, but separated by modules that you can enable independently and allow you to customize them for your community needs.

We’ve also made one of our priorities not to lock you to a single company API, so every community can pick the provider that makes sense for them, balancing data privacy, performance, feature sets, and vendor lock-in.

Community Sentiment

With the sentiment module, we will automatically classify every post in your community across sentiment (positive or negative) and/or emotion (joy, surprise, anger, disgust, fear, sadness, or neutral). This will allow your staff team to have insights into the community’s health and will help you to diagnose the sentiment across axes like category, topic, and user level.

Composer AI Helper

After composing your post, click on the :sparkles: icon and select any of the following options:

  • Suggest titles
  • Translate to English
  • Proofread

And after a couple of seconds, you will get some help from the AI.

This is enabled here on Meta for TL2+

Toxicity Detection

The toxicity module can scan both new posts and chat messages and classify them on a toxicity score across a variety of labels. Those toxicity scores are all available for reports, where the community moderators can identify content that may not be adequate for your instance.

And, if you want to get one step further, you can enable automatic flagging of content that crosses a customizable toxicity threshold, which will put the potential problematic content into the Discourse Review Queue, where they can be manually analyzed by your mod team.

NSFW Image Detection

The NSFW module will automatically scan every new upload in user posts and classify each image found for what’s usually considered NSFW content. The content of the classification is available via reports to your moderator team and, optionally, you can enable automatic flagging of content that crosses a certainty threshold.

Embeddings

This powers two modules at the moment:

Semantic Related Topics

When you get to the end of a topic, Discourse presents you with 5 suggestions of topics to read next. Nowadays, we pick 5 random topics for anonymous users and use the unread topics for logged-in users to populate that list, making it quick to generate but not very useful when you are researching a specific subject.

With the new Semantic Related Topics feature, we will use Semantic Textual Similarity between the current topic and all the other topics in your instance to suggest topics that are potentially more relevant to what a person is looking for.

This is enabled here on Meta for all, including anon

Semantic Search

This used the same logic we used for semantic related topics, but to power search results.

More on this soon.

Summarization

This module can summarize topics and chat channels, for times when you need a quick way to figure out what is going on.

Configuration

Check each module documentation topic:

Modules Providers

As we said above, we are committed to offer new AI features without compromising your privacy. See below the current providers and models for each module. CDCK handles hosting for open-source models in our infrastructure and API keys for SaaS providers like OpenAI:

Module Provider Processor
Toxicity UnitaryAI Discourse
Sentiment Emotion English DistilRoBERTa-base Discourse
Twitter-roBERTa-base for Sentiment Analysis Discourse
NSFW GantMan - nsfw Discourse
Open-NSFW 2 Discourse
Semantic Sentence Transformers Discourse
pgvector Discourse
Composer OpenAI Third party
Anthropic Third party
Summarization bart large cnn samsum Discourse
flan t5 base sansum Discourse
long t5 tglobal base 16384 book summary Discourse
OpenAI Third party
Anthropic Third party
AIBot OpenAI Third party
Anthropic Third party

:mega: Additional Discourse processor options for Composer / Summarization / AIBot are coming soon!

Disclaimer

We are being very mindful with our experimentation around AI. The algorithms we are leaning on are only as good as the data they were trained on. Bias, inaccuracies and hallucinations are all possibilities we need to allow for. We regularly revisit, test and refine our AI modules.

Self Hosting

Check the docs on self-hosting the API services at Discourse AI - Self-Hosted Guide

FAQ

Will this available on Discourse hosting? Which plans?

This is available in preview for Enterprise customers, please contact our support team to get it installed and configured on your instance.

Rollout for select modules for other tiers will follow later.

Will CDCK offer a SaaS version of the AI services API for self-hosted communities?

Not at the moment, but this is something we may consider given the feedback from our community.

:discourse2: Hosted by us? This plugin is available for preview on our Enterprise plan.

44 Likes

LangChain for LLM Application Development - A free (for now) DeepLearning.AI course by Harrison Chase (Creator of LangChain) and Andrew Ng (DeepLearning.AI)

3 Likes

Is there a recommended way to get pgvector on RDS?

this page claims:

The pgvector extension is available on all database instances in Amazon RDS running PostgreSQL 15.2 and higher in all AWS Regions, including the AWS GovCloud (US) Regions.

But last I knew, there was some subtle problem with PG14. I think this site is running on RDS, though.

Presumably typical self-hosters won’t have this problem as the current database image has pgvector, but both of the places I wanted to try this are running other pg installs. :crying_cat_face:

3 Likes

We fixed it! Meta has been running PG15 for 3 months or so. (brace for the self-hosted pg upgrade soon)

But while AWS doesn’t tell you upfront, you also have pgvector on PG 13.11 in there :wink:

pgvector is available in AWS RDS, Aurora, Azure, GCP and Digital Ocean hosted PostgreSQL services, so I think this won’t be a problem.

2 Likes

Cool. That’s good to know. Thanks. That’ll solve one problem. The other is a self-installed postgres image that does replication. Maybe I can figure out how to use the Discourse image and get replication working with it.

Thanks.

1 Like

pgvector is on the Ubuntu/Debian official PostgreSQL PPAs, so after having that enabled it’s a simple apt install pgvector away in any server / image you have access to.

2 Likes

Sigh. Strangely the postgres:13 docker image doesn’t solve the problem with apt as suggested. It seemed like the official pg image would be a safe way to go.

1 Like

Sorry that wasn’t really strict for copy and paste, the exact command would be

apt update && apt install postgresql-${PG_MAJOR}-pgvector
1 Like

:person_facepalming:

LOL. Thanks, my postgres and its replica are now updated and I installed it! Now for bug reports.

1 Like

Greetings, I express my gratitude for the plugin :raised_hands:
I have invariably relied on Google’s browser translator within this forum, a practice that significantly hampered my productivity due to Google’s occasional failure to comprehend the context of certain texts. In recent days, I have shifted my tendency towards the forum’s integrated artificial-intelligence translator, embodied in the message composer- a remarkable tool that has notably facilitated the drafting of my posts.
Amongst this forum’s population, it is likely that I am not the only one reliant on translator services. Thus, I would like to propose an enhancement: perhaps consider incorporating translation options for highlighted text outside the message composer. Specifically, as I traverse through the forum’s posts, I find myself translating each message via Google’s browser translator. Therefore, a commendable solution would be to introduce a “translation” button (with a dropdown list of supported languages), in addition to the existing “quote” and “share” buttons, post the highlighting of any part of the text.

1 Like

Now if memory serves me, that’s around the time you tend to deploy it to us standard install types.

Do you have a planned roll out schedule for PG15 in mind?

2 Likes

Yes, taking into account the last few times we should be introducing that upgrade in this or the next quarter indeed. Still, we have not started the self-hosting upgrade rollout yet.

3 Likes

Are you considering sending requests to artificial intelligence via Typeform form submissions?