This guide explains how to set up and manage Agents for Discourse AI - AI bot.
Required user level: Administrator
The Discourse AI bot includes a flexible system for managing Agents. This guide covers:
- Interaction methods for AI Agents
- Configuration options
- Advanced settings
- Supported tools
- Customization possibilities
Learn about the AI bot and how to enable it in this guide.
What are agents?
Agents are a powerful feature that allows you to customize the behavior of the AI engine in your Discourse forum. They act as a ‘system message’ that guides the AI’s responses and interactions, helping to create a more personalized and engaging user experience.
Why use agents?
With agents, you can tailor the AI’s behavior to better fit the context and tone of your forum. Whether you want the AI to be more formal for a professional setting, more casual for a community forum, or even embody a specific character for a role-playing game, agents give you the flexibility to do so.
Group-specific access to agents
Moreover, you can set it up so that certain user groups have access to specific agents. This means you can have different AI behaviors for different sections of your forum, further enhancing the diversity and richness of your community’s interactions.
Interacting with Agents
Agents can be interacted with in multiple ways:
- Private message (PM)
- Chat direct message (DM)
- Chat channel mentions
- Mention in a public topic via
@example_bot_username
Administrators can control which interaction methods are allowed for each agent via four separate toggles:
- Allow personal messages: Allow users to start PMs with this agent (enabled by default)
-
Allow topic mentions: Allow
@mentionin topics to trigger a response - Allow chat direct messages: Allow chat DMs with this agent (requires chat plugin)
-
Allow chat channel mentions: Allow
@mentionin chat channels (requires chat plugin)
Configuration
To configure Agents, navigate to discourse.example.com/admin/plugins/discourse-ai/ai-agents.
Key configuration options include:
- System prompt: Steers the conversation
- Vision support: Enable for Vision powered LLMs, i.e- GPT-4 Turbo, Claude 3
- Default model: Required for mentionable agents and agents with force default LLM enabled
- Allowed groups: Define permissions using Discourse group security
- Uploads: Index text files for additional knowledge (using RAG - Retrieval-Augmented Generation)
- Enabled tools: Control access to specific tools
- Execution mode: Choose between “default” and “agentic” mode (agentic mode enables multi-turn tool use with configurable token limits and compression)
Here’s a look at a complete AI agent configuration screen:
Advanced configuration options
The agent editor offers several advanced options:
- Temperature and top_p (nucleus sampling): Control creativity vs. predictability
- Max context posts: Limit the number of posts supplied to the LLM for history - fewer posts will reduce costs, but cause the AI to “forget” about older content (not available in agentic mode)
-
Execution mode: “Default” for single-pass responses, “Agentic” for multi-step tool use with:
- Max turn tokens: Token budget for agentic execution
- Compression threshold: Percentage threshold for context compression (20-99%)
- Show thinking: Display the AI’s reasoning process to users (enabled by default)
- Require approval: Require human approval before certain actions are executed
- Force default LLM: Prevent users from switching LLMs for this agent
- Response format: Configure structured output format
- Examples: Few-shot examples to guide the AI’s behavior (pairs of user/assistant messages)
-
Upload options:
- Chunk tokens: Control document splitting
- Chunk overlap tokens: Set overlap between chunks
- Search conversation chunks: Number of document fragments added to user queries
- Question consolidator LLM: Choose the LLM for determining user questions
- RAG LLM model: Choose a specific LLM for RAG processing
Prerequisites for upload support
To use upload support:
- Enable the
ai_embeddings_enabledsetting - Configure an embedding model via
ai_embeddings_selected_model
Discourse AI supports various embedding models. Hosted customers get free access to the bge-large-en model.
Self-hosters or people wanting more choice can self host an embedding model or use models by Open AI, Google (Gemini), and more.
Text splitting in Discourse AI
Discourse uses a Recursive Character Text Splitter to keep paragraphs, lines, and words together when splitting text. You can control text splitting using the [[metadata YOUR METADATA HERE]] separator:
[[metadata about cats]]
a long story about cats
[[metadata about dogs]]
a long story about dogs
This method prevents “chunk contamination” by ensuring only relevant data is included in each chunk.
Debugging AI agents
To debug your agent:
- Add users to the group specified in the
ai_bot_debugging_allowed_groupssetting - Users in this group will see an AI debugging button at the bottom of AI posts
- Click the button to access the debugging UI modal
Remember: If you provide vague or unhelpful information to an LLM, it will have great difficulty converting it into useful information.
Supported tools
Discourse AI supports various tools, including:
Always available
- Categories
- Time
- Search
- Read
- Database Schema
- Search Settings
- Setting Context
- Random Picker
- Web Browser
- Search Meta Discourse
- JavaScript Evaluator
- Researcher
- Flag Post
- Close Topic
- Unlist Topic
- Lock Post
- Delete Topic
- Edit Post
- Edit Category
- Set Topic Timer
- Set Slow Mode
- Move Posts
- Grant Badge
GitHub integration
- GitHub File Content
- GitHub Pull Request Diff
- GitHub Search Files
These three tools are always available. Additionally:
-
GitHub Search Code requires the
ai_bot_github_access_tokensetting to be filled
Conditional tools
- Tags and Edit Tags: Available when tagging is enabled on your site
- Image generation (Image, Create Image, Edit Image): Requires a custom image generation tool to be configured via the admin UI
-
Google search: Requires the
ai_google_custom_search_api_keyandai_google_custom_search_cxsettings to be filled -
Artifacts (Create Artifact, Update Artifact, Read Artifact): Available when
ai_artifact_securityis set to lax, hybrid, or strict - Assign: Available when the Assign plugin is installed
- Mark as Solved: Available when the Solved plugin is installed
Some tools require additional configuration or API keys.
Custom tool support
You can create your own tools using custom tool support.
Customizing system agents
- Create a new agent
- Copy and paste the system prompt from the agent you wish to customize
- Modify as needed
- Optionally disable the original system agent to avoid duplication
Customizing search
To customize search for a new agent:
- Create a new agent
- Add the “search” tool
- Configure search options, including:
- Base search query
- Maximum number of search results
- Include private topics option
This allows you to delegate search permissions, increase the number of results, or restrict search to specific sections of your site.
Last edited by @dax 2026-03-13T17:21:31Z
Check document
Perform check on document:



