EchordMind is a Discord bot that uses AI to engage in intelligent, context-aware conversations. It remembers past interactions, providing a personalized experience, making each conversation feel like interacting with a learning and growing companion.
The above description was written by AI. Simply put, you can create your best buddy, girlfriend, a llama that only says "hmm", or even a combat helicopter... and chat with them on Discord 👀.
Note
EchordMind is currently in early development stages. The content in this README may be outdated or incorrect. If you have any suggestions or issues, feel free to raise them in the Issues section.
Note
The name "EchordMind" is tentative. If you have a better idea, feel free to suggest one.
Switch Language: English | 繁體中文
- Conversation Handling: Responds to users in direct messages with context-aware replies.
- Memory System: Uses short-term and long-term memory to maintain conversation continuity.
- AI Integration: Implements natural language understanding and generation through LLMs API.
- Configurable Settings: Customize the bot's personality, language, and behavior via YAML files.
- Modular Architecture: Designed for scalability, making it easy to add new features or integrations.
- Go to the Discord Developer Portal and create a new application.
- On the Installation page, ensure that
User Installis selected. - On the Bot page, check the
Message Content Intentunder Privileged Gateway Intents and save. - On the OAuth2 page, check
applications.commands. For Integration Type, selectUser Install, and copy the generated URL. - Open the URL in any way and authorize the bot.
-
Clone the Repository
git clone https://github.com/Yuuzi261/EchordMind.git cd EchordMind -
Set Up Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Configure Environment Variables Create a
.envfile in the root directory:USER_ID=your_discord_user_id LOG_LEVEL=INFO LANG=en-us # now support en-us, zh-tw VECTOR_DB_PATH=data/ DISCORD_BOT_TOKEN=your_discord_bot_token GEMINI_API_KEY=your_gemini_api_key GROK_API_KEY=your_grok_api_key
Note:
USER_IDis currently used to send a test message when the bot starts. This is a temporary feature and may be removed in future versions.Admittedly, this method is quite useful, at least for personal use... -
Configure YAML Files Copy the sample configuration files and customize them:
cp configs/base_setting_sample.yaml configs/base_setting.yaml cp configs/exception_message_sample.yaml configs/exception_message.yaml cp configs/personality_sample.yaml configs/personality.yaml cp configs/role_settings_sample.yaml configs/role_settings.yaml
-
Run the Bot
python bot.py
Send a direct message to the bot to start a conversation. The bot will respond based on its configured personality and past interactions.
Example Conversation:
User: Hi, I'm planning a trip to Japan.
Bot: That sounds exciting! Japan has a rich culture. Do you have any specific destinations in mind?
User: Tokyo and Kyoto.
Bot: Great choices! Tokyo is vibrant, and Kyoto is full of history. Need any activity suggestions?
(Later)
User: I mentioned Japan earlier, now I want to add Osaka.
Bot: Yes, I remember Tokyo and Kyoto! Osaka is a fantastic addition, famous for its food. Want some dish recommendations?
Note
This example is for reference only. Once development is more complete, real conversation examples will be provided here.
The bot's behavior can be customized through YAML files in the configs/ directory:
base_setting.yaml: General settings, such as default model temperature, timestamp prompts, and weather prompts.exception_message.yaml: Custom error messages for various scenarios (e.g., API failures).personality.yaml: Defines the bot's personality throughsystem_promptand summarization settings.role_settings.yaml: Specifies roles for conversation tracking (e.g.,user,model).
EchordMind combines short-term and long-term memory to maintain conversation context:
- Short-term Memory: Stores recent conversation turns in memory.
- Mid-term Memory: Not yet implemented, may be added in the future, similar to long-term memory but more recent.
- Long-term Memory: Summarizes and stores important conversation content in a vector database for future retrieval.
When a user sends a message:
- The bot retrieves relevant long-term memories using vector search.
- Combines them with the short-term conversation history.
- LLMs generate a response based on this context.
- The response is sent to the user, and the conversation is updated in memory.
This system enables the bot to maintain coherent, context-aware conversations across multiple interactions.
Contributions are welcome! Please read the Contribution Guide to learn how to contribute, including coding standards and workflow.
This project is licensed under the MIT License.
For more detailed information, please refer to the project wiki.