How to implement a proof of concept RAG using Discourse AI

Notes for No Code RAG course

Get a free trial for Discourse from Communiteq

First get a free trial on Communiteq

I recommend them because they are the 2nd best option but are very budget friendly in case you plan to continue.

The best option is the hosting offered by the people who built Discourse (because it is more powerful) but it does not offer API access on the lowest price tier.

Make registration invite only

The first thing you need to do is to disable user registration (making it invite only). For now you will be using the forum as a way to do personal research. You can directly send email invites to other team members.

Copy paste the transcript from YouTube tutorial videos to Discourse

Please increase the maximum characters for a single post from 32K to 150K before doing this step

Next, you must paste the transcript of a YouTube video which already has chapters (these are usually added by the video creator)

For this example, I consider videos by Alex the Analyst on YouTube.

Here is an example video.

Learn Excel in Under 3 Hours | Pivot Tables, Lookups, Data Cleaning

First create a new topic in Discourse. The title will be the same as the YouTube video’s title.

Paste the YouTube video link.

Then paste the video’s description (if available) under the video URL, and click on “Create Topic”.

This will create one topic per YouTube video. Next we will create multiple posts as replies under this topic, where each post will correspond to the video transcript of one video chapter.

Click on Show Transcript button.

The transcript will appear on the right hand side. Now copy the entire transcript.

Paste the copied transcript into my YouTube transcript splitter tool.

This will split the transcript based on the chapters, and will create a tabbed view of each chapter.

Click on the Copy section without timestamps button for each chapter and paste it into the reply. Click on the Reply button to publish.

Repeat for the other tabs

Paste as reply to the original topic post.

Set up the LLM settings

Next you will need to connect an LLM to your Discourse forum.

I recommend using Gemini Flash 1.5 because
a) it is free and
b) it is actually pretty fast

Select Gemini Flash 1.5 under the LLM tab

Login to Google AI Studio using your Google account and get an API key

Paste this API key into the LLM settings

Make sure the AI Bot is checked, and click on Run test to confirm that you have set it up correctly

Click on Submit button, and you will see that the LLM has been added to your list of configured LLMs

Set up AI settings

In the AI settings page, select everything you need for getting things to work

First get familiar with the “Only show overridden” checkbox under AI settings. As the name implies, it filters all the settings down to only the ones which have been overridden. Since we haven’t made any changes under this tab yet, there are no results yet.

Add AI helper settings

The AI helper is a tool which can do things like read a post and automatically suggest a good title. You have probably already seen this in action when you ask ChatGPT a question and notice that a few seconds later it automatically adds a fairly suitable title as the topic of the conversation.

Make the following changes:

Add AI bot settings

Make the following changes:

The overridden settings will look like this:

You can now access the AI bot from the header

When you checked the option “Display a button in the header to start a PM with a AI bot” you will see a bot icon show up on the header

Before:

After:

Create a new bot persona

Create a new bot persona

Under the Persona tab, click on New Persona

click_new_persona2850×776 225 KB

Use a suitable name and description.
Enabled tools: Search, Read, Categories, Tags
Forced tools: Search, Read (this step is very important)

persona_settings_11088×1136 32.1 KB

The Base Search query will be used to make sure you filter the search to within the specific category (Transcript in this case)

persona_settings_21088×1160 55.4 KB

Make sure you provide a descriptive system prompt

Chat with the bot

Chat with the bot

First click on the bot icon in the header

Set bot type as Video Transcript Search

Once you have everything set up, you can ask questions to your Video Transcript Search bot. After a few seconds the AI helper will automatically provide a suitable name for the conversation topic.

And you can also ask followup questions