High-Performance Persistent Discord AI Bot
Vito is a low-latency, context-aware Discord bot engineered for speed, memory retention, and long-term conversational consistency.
Built by Yoruboku, Vito uses persistent HTTP sessions and a permanent JSON memory system to outperform standard Discord AI bot implementations.
Vito uses a persistent aiohttp session, avoiding repeated handshakes with external APIs.
This design yields responses 200–500ms faster per message than typical setups.
Vito remembers everything—permanently.
- memory.json stores user-specific data across restarts.
- Every message triggers an automatic lookup from this file.
- Relevant memory is injected directly into the system prompt so conversations stay consistent for weeks or months.
Vito intelligently routes messages between two engines:
- Primary (Gemini 1.5 Flash): Fast, logical, general assistance
- Secondary (OpenRouter/Llama): Accessed via
@Vito notnicefor alternative or unfiltered reasoning- Default:
google/gemma-3-4b-it:free
- Default:
A three-tier system ensures stable resource usage:
- Creator (Level 3): Full system control
- Admins (Level 2): Can terminate requests from standard users
- Users (Level 1): Limited to managing their own tasks
When Vito receives a message:
-
Parses Input:
Strips mentions, identifies commands (e.g., remember). -
Assembles Context:
- RAM: 1-hour short-term conversation history
- Disk: Permanent user memory from
memory.json - Prompt: Merges identity, memory, recent chat
-
Routes API Requests:
- Standard → Gemini
- “Not nice” → OpenRouter (Llama/other models)
-
Manages Response:
Auto-splits messages into ≤1900 characters to satisfy Discord API limits.
- Python 3.9+
- Discord Bot Token
- Gemini API Key
- OpenRouter API Key
- User/Admin IDs (enable Discord Developer Mode)
- Upload repository to your server
- Make installer executable:
chmod +x install.sh
- Run installation:
Select Option 2 (Install).
./install.sh
- Start the bot:
Select Option 1 (Start).
./install.sh
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtEdit settings.json with your tokens and model IDs.
Run the bot:
python3 main.pyVito is optimized to run 24/7 on the free tier.
cd Vito-bot
chmod +x install.sh
./install.sh| Setting | Value |
|---|---|
| Type | Custom Program |
| Command | /home/YOUR_USER/Vito-bot/venv/bin/python /home/YOUR_USER/Vito-bot/main.py |
| Working Dir | /home/YOUR_USER/Vito-bot |
| Monitoring | /bin/true |
Command:
pkill -f /home/YOUR_USER/Vito-bot/main.pySchedule: Daily at 23:59
All settings are stored in settings.json.
{
"creator_id": "YOUR_DISCORD_ID",
"admin_ids": "ADMIN_ID_1, ADMIN_ID_2",
"discord_token": "YOUR_DISCORD_TOKEN",
"gemini_key": "YOUR_GEMINI_KEY",
"openrouter_key": "YOUR_OPENROUTER_KEY",
"model_gemini": "gemini-2.5-flash",
"model_openrouter": "google/gemma-3-4b-it:free"
}To change the Llama/OpenRouter model, update model_openrouter.
Popular options:
- Uncensored:
nousresearch/hermes-3-llama-3.1-405b - High-intelligence:
anthropic/claude-3.5-sonnet
| Command | Example | Description |
|---|---|---|
| Chat | @Vito how do I cook rice? |
Standard Gemini response (now with automatic search grounding) |
| Remember | @Vito remember I have a cat named Luna |
Saves to permanent memory |
| Recall | @Vito what is my cat’s name? |
Automatically answered from memory |
| New Chat | @Vito newchat |
Clears short-term RAM context |
| Clear | @Vito clear or @Vito clear 50 |
Deletes bot commands and replies from recent history (default search: 1000 messages). |
| Not Nice | @Vito notnice define anarchy |
Uses OpenRouter model |
| Stop | @Vito stop |
Terminates current generation |
Vito-bot/
│── main.py # Bot logic, memory management, API routing
│── install.sh # Automated setup
│── settings.json # API keys + model configuration
│── memory.json # Persistent user memory
│── requirements.txt # Dependencies
Creator: Yoruboku
License: MIT
Powered By: Google DeepMind & OpenRouter