AskDB AI Bot
AskDB is a powerful AI base database query system that allows you to ask questions about your server and players. You can ask questions like "How many players joined my server in the last 24 hours?" or "What is the average player rating of my server?" and AskDB will answer them for you.
How it works?
AskDB uses various LLM (Large Language Model) providers to answer your questions. It uses the data from your server to answer your questions. Since it uses LLM APIs, you need to have an account on any supported LLM provider and their respective API key to use AskDB.
Supported LLM Providers
- OpenAI (GPT-3.5, GPT-4)
- Anthropic (Claude)
- Ollama (Local models)
- Mistral
- Groq
- XAI (Xai)
- Google (Gemini)
- DeepSeek
How to enable AskDB?
AskDB is disabled by default. To enable it, you need to follow these steps:
1. Choose and Setup an LLM Provider
By default, AskDB uses OpenAI's GPT-4 Turbo model. You only need to set different environment variables if you want to use a different provider or model.
The models(AI_MODEL) listed below are examples as of March 2024. Each provider frequently releases new and improved models. When setting up AskDB, check your chosen provider's documentation for their latest available models and choose one that best fits your needs in terms of capabilities and cost. The model names and capabilities might have changed since this documentation was written.
OpenAI (Default)
- Go to OpenAI and create an account (Login if you already have one)
- Navigate to
API Keys
section in your account settings - Create a new API key
- Use these environment variables:
AI_PROVIDER=openai # Optional, this is default
OPENAI_API_KEY=sk-...
AI_MODEL=gpt-4o-mini # Optional, this is default
Anthropic (Claude)
- Go to Anthropic and create an account
- Get your API key from the dashboard
- Use these environment variables:
AI_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-...
AI_MODEL=claude-3-opus-20240229 # Latest Claude model with similar capabilities
Ollama (Local Models)
- Install Ollama on your system
- Start the Ollama server
- Use these environment variables:
AI_PROVIDER=ollama
OLLAMA_API_BASE=http://localhost:11434
AI_MODEL=mixtral # Mixtral 8x7B model recommended for similar capabilities
Mistral
- Go to Mistral AI and create an account
- Get your API key from the platform
- Use these environment variables:
AI_PROVIDER=mistral
MISTRAL_API_KEY=...
AI_MODEL=mistral-large-latest # Latest large model
Groq
- Sign up at Groq
- Generate your API key from the dashboard
- Use these environment variables:
AI_PROVIDER=groq
GROQ_API_KEY=gsk_...
AI_MODEL=mixtral-8x7b-32768 # Mixtral model on Groq's infrastructure
XAI
- Get access to XAI's platform
- Generate your API credentials
- Use these environment variables:
AI_PROVIDER=xai
XAI_API_KEY=...
AI_MODEL=xai-large # Their most capable model
Google (Gemini)
- Go to Google AI Studio
- Create a project and get your API key
- Use these environment variables:
AI_PROVIDER=gemini
GEMINI_API_KEY=...
AI_MODEL=gemini-pro # Their most capable text model
DeepSeek
- Visit DeepSeek and create an account
- Generate your API key
- Use these environment variables:
AI_PROVIDER=deepseek
DEEPSEEK_API_KEY=...
AI_MODEL=deepseek-chat-67b # Their most capable chat model
2. Enable AskDB
Open .env file of your MineTrax Installation and edit these variables:
AI_ENABLED=true
ASKDB_ENABLED=true
Add/Edit the environment variables for the LLM provider you chose in the previous step. Eg: If you chose OpenAI, add the following variables:
AI_PROVIDER=openai
OPENAI_API_KEY=sk-...
AI_MODEL=gpt-4o-mini # Optional, this is default
3. Run update
Run the update script to apply the changes.
cd /var/www/minetrax
sh update.sh
4. Done!
Now you can go to AskDB section of your web admin sidebar and start asking questions.
Permissions
Only staff with use ask_db
permission can use AskDB. Please be careful while giving this permission to your staff as with this bot they can query anything from your minetrax database.
Passwords & Secret Keys, be it for the players or the servers, are stored in database in encrypted and hashed form. So you can't query them.