A multi-user movie recommendation web application with reinforcement learning capabilities. The system learns from each user's preferences over time to provide personalized movie suggestions.
📖 For complete documentation, see DOCUMENTATION.md
- 🎲 Random Movie Recommendations - Get personalized movie suggestions
- 🤖 Reinforcement Learning - The system learns from your feedback to improve recommendations
- 🎨 Beautiful UI - Modern, responsive design with TailwindCSS
- 📊 Genre-Based Learning - Uses multi-armed bandit algorithm to learn your genre preferences
- Backend: Flask (Python)
- Frontend: HTML + TailwindCSS (CDN) + JavaScript
- Movie Data: TMDB (The Movie Database) API
- RL Model: Multi-armed bandit with epsilon-greedy strategy
- Storage: JSON file for RL feedback data
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activatepip install -r requirements.txt- Go to TMDB
- Create a free account
- Go to API Settings
- Request an API key (free)
- Copy your API key
Windows (PowerShell):
$env:TMDB_API_KEY="your_api_key_here"Windows (CMD):
set TMDB_API_KEY=your_api_key_heremacOS/Linux:
export TMDB_API_KEY="your_api_key_here"Or create a .env file (not included in git):
TMDB_API_KEY=your_api_key_here
python app.pyThe application will be available at http://localhost:5000
The system uses a multi-armed bandit approach where:
- Each genre is an "arm" that can be pulled
- The system tracks:
- Total recommendations per genre
- Positive feedback (likes) per genre
- Expected reward = positive_count / total_count
-
Epsilon-Greedy Algorithm:
- 15% of the time: Explore (random genre)
- 85% of the time: Exploit (genre with highest expected reward)
-
Feedback Loop:
- When you click "I Like This" → reward = 1
- When you click "I Don't Like This" → reward = 0
- The system updates genre statistics and saves to
feedback_store.json
-
Over Time:
- Genres you like get recommended more often
- Genres you dislike get recommended less often
- The system adapts to your preferences
recom sys/
├── app.py # Flask application and routes
├── rl_model.py # Reinforcement learning model
├── tmdb_service.py # TMDB API integration
├── requirements.txt # Python dependencies
├── feedback_store.json # RL data (created automatically)
├── templates/
│ ├── index.html # Landing page
│ ├── movie.html # Movie recommendation page
│ └── error.html # Error page
└── README.md # This file
GET /- Landing pageGET /recommend- Get a movie recommendationPOST /feedback- Submit feedback (JSON:{"genre": "Action", "liked": true})GET /stats- View RL model statistics (debug endpoint)
- Visit
http://localhost:5000 - Click "Pick a Movie for Me"
- View the recommended movie
- Click "I Like This" or "I Don't Like This"
- Click "Pick Another Movie" to get a new recommendation
- The system learns from your feedback!
- Make sure you've set the environment variable before running the app
- Check that your API key is valid
- Check your internet connection
- Verify your TMDB API key is correct
- TMDB API might be temporarily unavailable
- Try again in a few moments
- User sessions to track individual preferences
- More sophisticated RL algorithms (UCB1, Thompson Sampling)
- Movie filtering by rating, year, etc.
- Watchlist functionality
- Multiple user support
This is a personal project for educational purposes.
- Movie data provided by The Movie Database (TMDB)
- UI inspired by pickamovieforme.com