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!
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
Hosted by us? Currently, this module is available for all hosted by Discourse customers on any plan.
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.
Embeddings → Improved search through Semantic Search
Configuration
Go to Admin settings-> Plugins → search or find discourse-ai and make sure its enabled
Checkmark ai_bot_enabled to enable AI Bot
Pick the group of users through ai_bot_allowed_groups to allow specific access to the AI Bot.
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
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.
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.
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
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.
It means it’s now been included for all our hosted customer sites.
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.
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.
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.
Nice catch. 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.
Are there any plans to update/extend the UX outside of PMs (i.e. via chat)?
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.
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)
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.
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.