Discourse AI + Google Search: website + forum | Is this correct?

AI-generated summary

janbolmeson is exploring the Discourse AI and Google Search integration. They have a website with blog posts and a forum on the same URL, and have set up the ai_google_custom_search_api_key to search for topics outside of the forum. They tested the ChatBot with three scenarios:

  1. Searching for topics within the forum, which uses internal search and does not require Google.
  2. Searching for posts outside of the forum on the same topic, which successfully used Google.
  3. They are unsure if the ai_google_custom_search_api_key was used correctly, as they set up the Google Search to exclude the forum path.

sam responded, stating that everything is debuggable with the data explorer plugin, and that the ai_api_audit_logs table contains the exact prompt generated. He suggests that the prompt may need to be adjusted to understand the restricted Google search, and an extra setting might be required.

Related to: Discourse AI - AI Bot (chatbot - ChatGPT- Anthropic) where it says:

So, I have been playing around with this and just want to make sure I understand this correctly.

My use-case is as follows (which I think applies to more people):

  • I have a website with a lot of blog posts

  • I have the forum on the same url

  • In my case the forum is not on a subdomain but in example.com/forum whereas all the other posts are in e.g. example.com/blog-post/. But it should not matter that much.

So what I did was:

  • Install the Discourse AI (love it btw)

  • Setup the custom google search API and CX

And started to play with the ChatBot. One question i told it was to:

  1. Get me all topics on a subject in the forum. Is it correct that for this it does not need google since it uses internal search? I am 99% sure it is that way.
  1. I then asked for all posts - except in the forum - on the same topic. I.e. I wanted it fetch them outside the forum. It worked, since it said it said it used Google.

  1. Can I deduce it used the ai_google_custom_search_api_key correctly?

Because what I am thinking of is that I setup the Google Search specifically to exclude the forum path. I.e. as below. But is this nescessary or am I overthinking it since it used the -inurl forum already in the query… :thinking:

Everything is 100% (sort of easily) debuggable. If you install data explorer you can see the actual JSON payload we injected in the prompt stream. The table ai_api_audit_logs contains the exact prompt we generated.

My original use case for Google was just to allow it to search everywhere, not restrict it down. That said, I think you can manage to get something working here. We may need though to adjust the prompt a bit to understand that this this google search is restricted. We may need an extra setting for it.