A Hatsune Miku-themed Discord AI chatbot powered by Groq β with smart model routing, memory, TTS, and a web dashboard.
- π€ Smart Model Routing β Automatically picks the best AI model based on your message:
Llama 4 Scoutβ Quick repliesGPT OSS 120Bβ Deep reasoning & codeKimi K2β Long conversations (10+ messages)
- π§ Persistent Memory β Miku remembers facts about each user via
[remember:key=value]tags - π Emotion-aware GIFs β Detects mood from responses and sends matching Hatsune Miku GIFs via Giphy
- π Text-to-Speech β Supports ElevenLabs, Groq PlayAI (English & Arabic)
- ποΈ Vision Support β Send images and Miku will analyze them
- π XP & Levelling System β Users earn XP from chatting
- π Web Dashboard β Manage system prompt, models, memory, and activity status via browser
- πΎ Dual Database β SQLite for local hosting, Supabase for cloud deployment
| Component | Technology |
|---|---|
| Bot Framework | discord.py |
| Web Dashboard | Quart (async Flask) |
| AI Backend | Groq API |
| Database | aiosqlite / Supabase |
| TTS | ElevenLabs / Groq PlayAI |
| GIFs | Giphy API |
git clone https://github.com/M5Develop/MikuBot-Discord.git
cd MikuBot-Discordpip install -r requirements.txtcp .env.example .envThen fill in your keys in .env.
python main.pyThe bot will start and the dashboard will be available at http://localhost:8000/dashboard
| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN |
β | Your Discord bot token |
GROQ_API_KEY |
β | Groq API key (free at console.groq.com) |
GIPHY_API_KEY |
For animated Miku GIF responses | |
ELEVENLABS_API_KEY |
For ElevenLabs TTS | |
ELEVENLABS_VOICE_ID |
ElevenLabs voice ID | |
SUPABASE_URL |
Supabase URL (cloud mode) | |
SUPABASE_KEY |
Supabase anon key (cloud mode) |
Note: If
SUPABASE_URLandSUPABASE_KEYare not set, the bot automatically uses local SQLite β no setup needed!
Mention the bot or DM it to start a conversation:
@MikuBot Hey, what's the difference between a stack and a queue?
@MikuBot [attach image] What's in this image?
- Update Miku's personality/system prompt
- Switch AI models manually or set to auto-routing
- Enable/disable TTS and choose voice engine
- View top fans (XP leaderboard)
- Browse and delete user memories
- Clear chat history per user
MikuBot-Discord/
βββ main.py # Entry point β bot + Quart dashboard
βββ database.py # MikuMemory class (SQLite + Supabase)
βββ requirements.txt
βββ .env.example
βββ cogs/
β βββ ai_chat.py # Core AI chat, routing, TTS, GIFs, memory
β βββ levelling.py # XP system
β βββ voice.py # Voice channel features
βββ templates/
βββ dashboard.html
βββ layout.html
Miku can remember facts mid-conversation. Just say something like:
"My favorite color is teal"
And Miku will internally tag [remember:favorite_color=teal] and recall it in future messages.
Memories can be viewed and deleted from the dashboard.
Works great on:
MIT β free to use, modify, and build on.