Enable AI Bot

This topic covers the configuration of AI Bot module of the Discourse AI plugin.

Overview

The AI Bot is a chatbot that allows for direct integration with generative AI powered by OpenAI (ChatGPT), Anthropic (Claude), Stability AI (Stable Diffusion) and others!

AI Bot walkthrough

Features

  • Ability to pick the specific AI Bot persona you want to interact with
  • Flexibility around which Large Language Model (LLM) provider you can use (Anthropic/Open AI)
  • Multiple people can interact with the AI Bot at the same time in the same UI
  • Automatically titles private messages (PMs) with the AI Bot
  • Replies are generated continuously through streaming and can be stopped at any time
  • Enable bot for a specific subset of users

Personas

Depending on the help you need, you have several different “personas” to choose from. These personas are preset and predefined, users can pick any of the personas before chatting with AI Bot. These personas are designed to best serve the needs of your community and help you get the best answer to your questions…

  • Forum Helper: General purpose AI bot capable of performing various tasks. Can search your current Discourse instance and use that information to build responses
    • i.e - What are the top posts for AI?
  • SQL Helper: AI Bot specialized in helping craft SQL queries on this Discourse Instance (aware of your current DB schema)
    • i.e - Write me a query to find all the AI bot messages by a specific customer/user
  • Artist: AI Bot specialized in generating images. Need a Stable Diffusion API key
    • i.e - Draw me a picture of a cat
  • Settings Explorer: AI Bot specialized in helping explore Discourse site settings. (aware of Discourse source code)
    • i.e - How do I enable Discourse AI on my Discourse site?
  • Researcher: AI Bot with Google access to research information for you. Need a Google Custom Search API key
    • i.e - How many legs does a dinosaur have?
  • Creative: AI Bot without any external integrations
    • i.e - Come up with 5 ideas to improve community engagement

Availability

:discourse: Hosted by us? Currently, this module is available for all hosted by Discourse customers on any plan. :tada:

It comes pre-installed on most plans, and if you’re an Enterprise customer you can contact us to have it added to your site on request. :discourse:

:information_source: Self-hosted users can install the plugin anytime by following Install Plugins in Discourse - sysadmin - Discourse Meta

Enabling AI Bot

Prerequisites

  • Must configure at least one provider for Large Language Model (LLM), from the options below:

    • OpenAI
    • Anthropic
    • Azure OpenAI
    • AWS Bedrock with Anthropic access
    • HuggingFace Endpoints with Llama2-like model
    • Run your own OSS Llama2-like model with TGI
  • Optionally, configure the following to get extra features:

Configuration

  1. Go to Admin settings-> Plugins → search or find discourse-ai and make sure its enabled
  2. Checkmark ai_bot_enabled to enable AI Bot
  3. Pick the group of users through ai_bot_allowed_groups to allow specific access to the AI Bot.
  4. Select the Large Language Model (LLM) model you would like to use ai_bot_enabled_chatbots, by default its GPT-3.5-turbo but you can also pick GPT-4 and/or Claude-2

Technical FAQ

  • Why am I seeing bot users such as claude_bot, gpt3.5_bot and gpt4_bot being added as admins to my site?
    • These users are necessary for AI Bot to function. They don’t do anything in the background and are only used when interacting with the bot.

Caveats

  • The bot is an area of much experimentation and is changing rapidly
  • The bot does not always provide 100% accurate results
  • We recommend enabling the bot for specific user groups to help control costs, as 3rd party providers charge on a per usage basis
20 Likes

Per:

I don’t want perfect to be the enemy of good here.

I changed it so all the extra fancy stuff like search integration and image generation is only implemented on GPT 4 which is able to properly deal with the very complicated prompt.

I have some ideas on bringing these features to GPT 3.5 / Claude as well, but in the interim the basics are mighty useful on the simpler models.

  • Multiple people can interact with LLMs in a single session (something that is not possible in chat.openai.com)
  • Stuff streams like it does in the official UIs and can be cancelled.
  • We get access to our Markdown engine so you can get it to draw mermaid diagrams and other fancy things.

So this is very useful for general purpose tasks on the simpler models today.

3 Likes

Given the latest news from OpenAI I am delighted to now support GPT 3.5 with full bot capacity! (to be merged soon)

Sadly I still can not get anthropic to work in this department, techniques such as GitHub - microsoft/guidance: A guidance language for controlling large language models. may get it there, but it can get super expensive.

6 Likes

Hello, I am currently actively testing this plugin. Many questions (suggestions) arise. One of them:
I think it would be advisable to implement a quota system, as implemented in the chatbot plugin:

Otherwise, there is a risk of abuse of requests to artificial intelligence by both ordinary users and staff. I tried to limit requests in ChatGPT using the site settings to limit the number of topics /site_settings/category/rate_limits and private messages, but this applies to the entire forum as a whole, which is not the best solution, limiting normal communication between users. But, even when using the normal forum settings, there is no way to limit the number of posts in topics (via the Replay button function).

When introducing a quota system, I believe that it is necessary to provide for the possibility of differentiating quotas for public posts and personal messages.
Such an approach could serve as a vital instrument to spur users into engaging with the chatbot for private communication or alternatively, for interacting in the arena of public posts. By extension, this mechanism could be harnessed as a means to encourage our users to converse more copiously with the chatbot in the public sphere, thereby augmenting the expanse of the public knowledge base. The corollary of this strategy would be an enriched user experience in the utilisation of artificial intelligence.

1 Like

Question 2:
How (in what settings) do I need to make changes to the plugin in order for Aibot to appear as an assistant for my site, for example, “I am an assistant for mysitename.com”. At this time, he introduces himself as the Discourse assistant, confusing users a little :sweat_smile:

Question 3:

What do I need to do so that Aibot suggests a title for a message (for a post) not in English but in my language, for example in Russian?


I tried to translate the built-in (hidden) prompts myself through the text settings /admin/customize/site_texts?q=, but I did not find such a prompt there.

1 Like

I’m afraid I don’t understand the meaning of this.

It means it’s now been included for all our hosted customer sites. :partying_face:

If you’re self hosted you’d need to install and configure this as you would any other AI module, and if hosted by another provider you would need to discuss with them what their options are.

2 Likes

It also says one needs to be on an Enterprise plan to enable it. What I don’t understand is what “availability” or “being included” actually entails then.

This bit? :point_up:

The way our hosted sites are set up, Free, Basic, Standard, and Business have all of their plan’s available plugins pre-installed, whereas Enterprise pick the ones they want out of the whole range and we install them individually.

So someone on the Business plan (for instance) will see the plugin on their /plugins page and can add their api keys and enable it from there, but an Enterprise customer would send us an email first and we’d install it for them.

I think it may have been written from an ‘assumed knowledge’ point of view though, so we can likely rephrase it to make it more transparent.

4 Likes

Yes, I think that’s a bit difficult to understand right now.

But also this statement on Discourse AI:

This needs to be updated because the plugin is available on all plans now?

2 Likes

Nice catch. :+1: We’ve only just made this change in the last day or so, so you may find more like that. If you spot any please shout out and we’ll update them. :heart:

3 Likes

Is it feasible for this extension to utilize disparate API addresses and keys for ChatGPT3.5 and ChatGPT4?

1 Like

Not at the moment

2 Likes

Couple questions about the bot:

  1. Are there any plans to update/extend the UX outside of PMs (i.e. via chat)?
  2. Are there any plans to allow the personas to be configurable at a group level? For example, maybe we only want the SQL and Settings personas to be accessible to admins.
  3. How feasible would it be to incorporate a rating system for the AI Bot responses (e.g. Was this response helpful? prompt with Yes/No)
1 Like

@joffreyjaffeux had a prototype for streaming API in chat that could give us that. I would like us to also support this modality.

Interesting, have not thought of this previously, but it is certainly a change that makes sense.

Not too tough, especially if it just gathers data and the querying is done via data explorer.

8 Likes

I also support this proposal. Currently, I have to specify minimal roles (for example, general) for all users in the plugin settings, and when I need to make an sql query, I turn on sql_helper for a while, then turn it off again, and this is very inconvenient. In my case, I imagine it this way: for the Group-A group the character is general, for Group-B the characters are general + artist, and for the staff and VIP-group all the bot characters.

2 Likes

I also wanted to suggest adding an arrow indicating that you need to click on the character’s button to open the list. For example:

1 Like

It looks to me like someone thought of it, at least for custom personas (see the allowed_group_ids below). Though I’ve not paid careful attention to any of this, I think it may make sense to move all personas into the custom personas model and populate the current defaults with fixtures. That would give group-level control over personas almost for free.

2 Likes

Minor typo in the announcement:

Once enabled you should see a our “AI Bot icon” in the top right corner.

Perhaps more importantly, the “once enabled” paragraph glosses over how to install the plugin on self-hosted instances.

1 Like

This is already mostly implemented now in the backend, I am working on the UI now and should get something going pretty soon

That was me acting on feedback here :slight_smile:

4 Likes