How can I restrict an AI Agent to answer only questions related to my forum?

I’m setting up Discourse AI on my forum and have an AI Bot/Agent working with Gemini 2.5 Flash via LiteLLM and Google Vertex AI.

The bot is working, but I have a problem with its scope.

For example, my forum is a business-focused community. If I ask the bot:

“Who owns Uber?”

it answers the question using the LLM’s general knowledge, even though the question has nothing to do with my forum.

This creates two problems:

  1. I want the bot to function as a forum-specific knowledge assistant, not as a general-purpose Gemini/ChatGPT interface.
  2. I don’t want users to be able to ask arbitrary questions and consume my LLM credits.

What I would ideally like is:

User asks question

Is it relevant to this forum?

NO → politely refuse

YES

Search forum knowledge

Generate answer based on forum content

Have you taken a look at Agents? Perhaps the Forum Researcher or Forum Helper Agents would be a better fit, as they are tuned to work with the forum specifically. Or is that what you are already using?

Forum Helper also has this problem:

image

Hmm… then perhaps you might want to make your own agent with a customized system prompt to not respond to queries outside of your forum’s scope.