Jan 2026

Discord Productivity Chatbot with Custom Retrieval-Augmented Generation

Left: the Bionix Chatbot’s card from the Bionix server’s user list. Right: example of the Bionix Chatbot answering typical questions about Bionix activities.

Within many organizations, software such as Discord is used for communication and collaboration. Alberta Bionix uses its Discord server extensively, with some people being pinged (contacted) for questions that could be answered by simply reading old messages. However, with over 200 members in the server, it is often impractical to go looking for a specific past message.

To address this challenge, I developed the “Bionix Chatbot”. It harnesses the power of large language models (LLMs), and augments them with both short-term and long-term contextual awareness. The short-term component handles up to 100 recent messages from across the Discord server’s more than 40 channels. The long-term component handles more than 30,000 past messages at a time, using a custom-coded retrieval system known as TF-IDF (text frequencyinverse document frequency).

Link to GitHub Repository

Technical implementation of the Bionix Chatbot:

  • Deployed on Replit.

  • LLM inference provided by Groq (Llama 3.3 70B).

  • Short-term context provided by recent messages passed directly to LLM prompts.

  • Long-term context provided by TF-IDF lexical similarity search passed to LLM prompts.

  • TF-IDF vectorizer with 5000-feature limit and 1 -to 3- word n-grams.

  • TF-IDF lexical similarity search returns most relevant messages measured by cosine similarity, and is automatically rebuilt every hour.

Example of various Bionix-specific questions answered by the chatbot.

Preliminary evaluation shows that the Bionix Chatbot accurately retrieves and answers questions from past messages, without requiring multiple attempts or careful prompt engineering. These results suggest that members can rely on the chatbot to retrieve relevant information effectively even for queries it has never seen before.

By automating knowledge retrieval, the Bionix Chatbot reduces unnecessary interruptions, minimizes repeated questions, and improves overall productivity by allowing members to focus on higher-value work.

Previous
Previous

Python Neural Network from Scratch

Next
Next

Alberta Bionix Website