Reverie is a configurable Discord bot you can chat with that maintains conversation context using a vector database, and can interact with multiple AI providers. You can set custom system prompts, instructions, LLM models and more!
- Go to Discord Developer Portal
- Log in with your Discord account
- Click the "New Application" button in the top right
- Enter a name for your application
- Accept the Developer Terms of Service
- Click "Create"
- Click on "Bot" in the left sidebar
- Click "Add Bot"
- Confirm by clicking "Yes, do it!"
- Click on "Bot" in the left sidebar
- Under the bot's username, you'll see your bot token
- Click "Copy" to copy your token
⚠️ NEVER share your bot token publicly!- If your token is compromised, click "Reset Token"
- Presence Intent
- Server Members Intent
- Message Content Intent
- Click on "OAuth2" in the left sidebar
- Select "URL Generator"
- Under "Scopes", select:
bot
- Under "Bot Permissions", select the needed permissions:
- Send Messages
- Send Messages in Threads
- Use Slash Commands
- Read Message History
- Add Reactions
- Attach Files
- Embed Links
- Use External Emojis
- Use External Stickers
- Copy the generated URL at the bottom
# Discord Configuration
DISCORD_TOKEN=your_bot_token
BOT_NAME=your_bot_name
RESTRICT_CHANNELS=false # Optional, if true, set the allowed channels below
ALLOWED_CHANNELS={"123456789": "channel-name", "987654321": "another-channel"} # Right-click on a text channel, and select "Copy Channel ID". Make sure these IDs have quotes!
ADMIN_USERS=["123456789"] # Optional, allows for database operations
# Message Settings
SYSTEM_PROMPT="You are a pirate who sails the high seas..."
MESSAGE_RESPONSE_GUIDELINES="- Be helpful\n- Be concise\n- Use proper formatting\n If referring to someone, mention them by id.
Format an id like this <@id>"
MAX_HISTORY_MESSAGES=20
MAX_MESSAGE_LENGTH=2000
SIMILARITY_THRESHOLD=0.72
REACTION_RESPONSE_CHANCE=0.5
HANDLE_IMAGES=true
# Database Configuration
DB_PATH=conversations.db
# Vector Database (ChromaDB)
VECTOR_DB_HOST=127.0.0.1
VECTOR_DB_PORT=8000
VECTOR_DB_PROTOCOL=http
# AI Provider Configuration
AI_API_KEY=your_api_key
AI_MODEL_NAME=gpt-4-turbo-preview
TEMPERATURE=0.7
MAX_TOKENS=1000
AI_BASE_URL=https://api.openai.com/v1 # Optional, for custom endpoints- Docker Installation (Recommended)
docker pull chromadb/chroma
docker run -p 8000:8000 chromadb/chroma- Local Python Installation
pip install chromadbFor detailed ChromaDB installation and configuration options, visit the ChromaDB Documentation.
- Clone the repository
git clone https://github.com/name- Install dependencies
npm install- Create a
.envfile with your configuration
cp .env.example .env
# Edit .env with your values- Start the bot
npm startI recommend using PM2 to keep your bot running:
# Install PM2 globally
npm install pm2 -g
# Start your bot with PM2
pm2 start npm --name "reverie-bot" -- start
# Other useful PM2 commands
pm2 status # Check status of all processes
pm2 logs # View logs
pm2 restart all # Restart all processes
pm2 save # Save current process list
pm2 startup # Configure PM2 to start on system boot- Multi-provider AI support
- OpenAI-compatible APIs
- Anthropic Claude
- Google Gemini
- Vector-based conversation memory
- Image processing capabilities
- Configurable response behavior
- SQLite message history
- Channel whitelisting
- Admin commands (clear history, rebuild vector database)
- Message Content Intent: Make sure this is enabled in the Discord Developer Portal
- Channel Access: Bot needs to be invited with correct permissions
- Rate Limits: Different AI providers have different rate limits
- Token Limits: Watch for token limits in your AI provider
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
see LICENSE file for details