An intelligent Discord bot powered by Mistral AI that serves as a personal fitness coach, helping users track workouts, maintain streaks, and achieve their fitness goals. The bot provides personalized workout plans, daily check-ins, and motivational support through natural conversation.
This Discord bot combines the power of large language models with structured fitness tracking to create an engaging and effective fitness coaching experience. It helps users:
- Set and track fitness goals
- Generate personalized workout plans
- Maintain daily workout streaks
- Receive timely reminders
- Track progress over time
- Get form tips and exercise suggestions
-
Discord Bot Layer
- Handles message routing and command processing
- Manages Discord-specific functionality
- Provides user interface through Discord
-
Application Layer
- AI Agent: Orchestrates conversations and AI interactions
- Workflow Manager: Handles user states and session management
- Command Handler: Processes user commands and responses
-
AI Services
- Integrates with Mistral AI for natural language processing
- Generates personalized responses and workout plans
- Provides contextual fitness advice
-
Data Layer
- MongoDB for persistent storage
- Tracks user progress and streaks
- Stores conversation history and workout data
# Required software
- Python 3.8+
- MongoDB
- Discord Developer Account- Clone the repository:
git clone https://github.com/yourusername/ai-fitness-coach.git
cd ai-fitness-coach- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
# Create .env file
DISCORD_TOKEN=your_discord_token
MISTRAL_API_KEY=your_mistral_api_key
MONGODB_URI=your_mongodb_uri- Initialize the database:
python setup_db.pypython bot.py!start_workout- Begin an interactive workout session!end_workout- End an interactive workout session!streak- Check your current workout streak!progress [days]- View your workout history!reminder HH:MM- Set daily check-in time!timezone- Set your timezone for reminders!reset- Reset your fitness tracking data
- Natural conversation about fitness goals
- Personalized workout recommendations
- Form tips and exercise modifications
- Progress tracking and motivation
- Streak maintenance and celebrations
- Daily check-in reminders
- Streak tracking
- Progress monitoring
- Timezone-aware scheduling
- Workout history logging
-
Enable required intents in Discord Developer Portal:
- Message Content Intent
- Server Members Intent
- Presence Intent
-
Configure bot permissions:
- Send Messages
- Read Message History
- Add Reactions
- View Channels
-
MongoDB setup:
- Create a database named 'fitness_bot'
- Collections: users, workouts, progress
-
Update connection string in
.env:
MONGODB_URI=mongodb://username:password@host:port/fitness_botai-fitness-coach/
├── bot.py # Main Discord bot implementation
├── agent.py # MistralAgent implementation
├── database.py # Database operations
├── utils/
│ ├── constants.py # System prompts and constants
│ └── helpers.py # Utility functions
├── requirements.txt # Project dependencies
└── README.md # Project documentation
- Create new command in
bot.py:
@commands.command()
async def new_command(self, ctx):
# Implementation- Add database operations in
database.py - Update AI prompts in
constants.py - Test thoroughly before deployment
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Mistral AI
- Help from Cursor! :)
For support, please:
- Check the documentation
- Open an issue
- Join our Discord community
