This Discord bot utilizes the Retrieval-Augmented Generation (RAG) approach to enhance the output of a large language model by referencing an authoritative knowledge base outside of its training data sources. The bot is designed to interact with users through Discord slash commands, allowing them to query an underlying knowledge base for relevant information.
Before running the bot, make sure you have the following dependencies installed:
- Python 3.10 or higher
- Clone the repository to your local machine:
git clone https://github.com/nur-zaman/LLM-RAG-Bot.git
cd LLM-RAG-Bot
- Create a virtual environment (optional but recommended):
python -m venv venv
- Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On Unix or MacOS:
source venv/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
- Rename the
.env.example
file to.env
in the project root directory and add your tokens and api keys:
DISCORD_BOT_TOKEN=your_bot_token_here
OPENAI_API_KEY=your_openai_api_key
Execute the run.bat
file to start the bot:
run.bat
This will launch the bot, and you should see "Ready" in the console once it has successfully connected to Discord.
The bot responds to a single slash command:
- Description: Enter your query :)
- Options:
input_text
(required): The input text for the query.
- Description: Updates your information database