Overview#
The SmartResponse Addon for Drako Bot is a modular, AI-driven response system designed for Discord servers. It supports multiple AI providers, handles multi-step interactions, and integrates seamlessly with internal knowledge bases for context-aware responses. The system is built with extensibility in mind, allowing developers to add new AI providers or customize bot behavior without modifying core logic.Features#
Automatic Node.js module management Missing modules are detected and installed on first run.
Multi-provider AI support via Vercel AI SDK Supports OpenAI, Groq, Mistral, and easily extendable to other providers. Multi-step response handling with interactive Discord buttons.
Internal knowledge base integration for enhanced context-aware replies.
Advanced message matching using semantic similarity and stemmed matching.
Discord modal and button interactions for user-friendly input.
Conversation caching with automatic timeout management.
Modular and maintainable architecture for easier future extensions.
Note: Auto-installation occurs for missing modules, ensuring smooth first-time setup.
Configuration#
All bot settings are defined in config.yml.SmartResponses#
Configure default AI behavior and internal data sources:AI Providers#
Define API keys, models, and response settings:Phrases#
Define triggers and responses:Adding New AI Providers#
The modular architecture makes it straightforward to add new AI providers. The following guide outlines the required steps.Step 1: Install Provider SDK#
Install the official SDK for your AI provider:Step 2: Create Provider Module#
Create a new file in providers/, e.g., anthropic.js:Step 3: Update Providers Index#
Include the new provider in providers/index.js:Step 4: Update SmartResponse Logic#
Modify SmartResponse.generateAIResponse to handle the new provider:Add the new provider configuration in config.yml:Step 6: Test Your Provider#
Restart the bot and confirm the new provider works.
Send a test message in a whitelisted channel.
Ensure the AI responds as expected.
Usage#
Bot Interaction#
The bot listens to messages in whitelisted channels and categories.
If RequireMention is enabled, mention the bot to trigger a response.
Multi-step responses use Discord buttons:Show Next Step: Proceed to the next message in a sequence.
Ask Another Question: Opens a modal for new input.
Internal Knowledge Base#
Place your reference documents in resources/docs/, resources/wiki/, or resources/knowledge_base/.
The bot automatically indexes and retrieves context from these sources.
Conversation Cache#
Responses are cached to improve performance.
Cache timeout ensures memory is not consumed indefinitely.
Automatic Module Management#
The bot verifies required modules on runtime:Logs missing dependencies.
Installs them automatically via npm install.
Continues execution after installation.
natural, fs, path, js-yaml, discord.js,
@ai-sdk/openai, @ai-sdk/groq, @ai-sdk/mistral, ai
Credits#
John – Owner of Drako Bot and original creator of SmartResponse.
Modified at 2025-10-23 17:49:25