A personalized event recommendation system that matches users with events based on their personality preferences and location.
EventGen AI helps you discover events that match your personality and preferences. Simply answer a short questionnaire, and the system will:
- Generate a personality profile based on your answers
- Search for events in your area (currently focused on Toronto)
- Match events to your personality using AI embeddings
- Recommend the top events with personalized explanations
EventGen AI uses a two-stage pipeline:
- Event Collection: Searches Eventbrite using Tavily AI to find event URLs, then extracts detailed information using GPT
- Personalized Matching: Converts both user preferences and events into 10-dimensional personality embeddings, then ranks events by similarity
For detailed architecture information, see ARCHITECTURE.md.
Before you begin, make sure you have:
- Python 3.11+ installed (Download here)
- Git installed
- API Keys (you'll need these):
- OpenAI API key (Get one here)
- Tavily API key (Get one here)
- Google Maps API key (Get one here) - Optional, for geocoding
git clone https://github.com/ece1786-2025/EventGenAI.git
cd EventGenAIOption A: Using venv (Recommended)
On Windows:
# Create virtual environment
python -m venv .venv
# Activate it
.\.venv\Scripts\Activate.ps1
# If that doesn't work, try:
.\.venv\Scripts\activate.batOn Mac/Linux:
python3 -m venv .venv
source .venv/bin/activateOption B: Using Conda
conda create -n eventgenai python=3.11
conda activate eventgenai๐ก Tip: You'll see
(.venv)or(eventgenai)in your terminal when the environment is active.
# Upgrade pip first
python -m pip install --upgrade pip
# Install all required packages
pip install -r requirements.txt-
Copy the example environment file:
cp .env.example .env
-
Edit
.envand add your API keys:OPENAI_API_KEY=your-openai-api-key-here TAVILY_API_KEY=your-tavily-api-key-here GOOGLE_MAPS_API_KEY=your-google-maps-api-key-here
โ ๏ธ Important: Never commit your.envfile to Git. It's already in.gitignore.
The pipeline has two main stages:
This stage searches Eventbrite by category and collects event URLs.
python backend/pipeline.py --stage 1 --categories music arts food-and-drink --location "Toronto, Canada" --max-events-per-subcategory 10Parameters:
--stage 1: Run only Stage 1 (URL collection)--categories: Which event categories to search (space-separated)- Available:
music,arts,food-and-drink,sports-and-fitness,health,business,science-and-tech
- Available:
--location: City and country to search in--max-events-per-subcategory: How many events to collect per subcategory (default: 10)
Output:
- CSV files saved to:
data/search_results/csv_files/ - Master JSON updated:
data/search_results/all_events_master.json
This stage processes the collected URLs and extracts detailed event information using GPT.
python backend/pipeline.py --stage 2 --stage2-batch-size 10Parameters:
--stage 2: Run only Stage 2 (event detail extraction)--stage2-batch-size: How many events to process at once (default: 10)
Output:
- Updated master JSON with event details:
data/search_results/all_events_master.json - Raw GPT responses saved to:
data/search_results/gpt_responses/
python backend/pipeline.py --stage all --categories music arts --location "Toronto, Canada" --max-events-per-subcategory 10 --stage2-batch-size 10This will:
- Collect event URLs for the specified categories
- Extract detailed information for all collected events
- Remove expired events automatically
After collecting events, generate personality embeddings for each event:
cd backend/event_manager/event_embedding
python generate_event_embeddings.pyOutput:
- Events with embeddings saved to:
data/search_results/all_events_with_embedding.json
Start the Flask server to handle user questionnaire submissions:
cd backend
python app.pyThe API will be available at: http://127.0.0.1:5000
Available Endpoints:
POST /embedding- Submit questionnaire answers and get user profile
-
Open the questionnaire:
# Open directly in your browser (double click the file): frontend/index.html -
Fill out the questionnaire with your preferences
-
Submit to generate your personality profile
Once you have:
- Event data with embeddings (
all_events_with_embedding.json) - Your user profile (saved in
data/users/)
Run the ranking system:
cd backend/filter_rankings
python ranking.pyThis will output your top recommended events based on personality similarity.
Here's a complete example of collecting events and getting recommendations:
# 1. Activate your environment
.\.venv\Scripts\activate.bat # Windows
# source .venv/bin/activate # Mac/Linux
# 2. Collect 100 music events from Toronto
python backend/pipeline.py --stage 1 --categories music --location "Toronto, Canada" --max-events-per-subcategory 10
# 3. Extract event details
python backend/pipeline.py --stage 2 --stage2-batch-size 10
# 4. Generate event embeddings
cd backend/event_manager/event_embedding
python generate_event_embeddings.py
# 5. Start the backend API (in a new terminal)
cd backend
python app.py
# 6. Open frontend/index.html in your browser and fill out the questionnaire
# 7. Get recommendations
cd backend/filter_rankings
python ranking.pyIssue: "Fatal error in launcher" or "Unable to create process"
Your .venv was created on a different computer or copied from elsewhere.
Solution:
# Delete and recreate
Remove-Item -Recurse -Force .venv
python -m venv .venv
.\.venv\Scripts\activate.bat
pip install -r requirements.txtIssue: PowerShell execution policy blocks scripts
Solution: Use activate.bat instead:
.\.venv\Scripts\activate.batIssue: Packages fail to install
Solution: Upgrade pip first:
python -m pip install --upgrade pip
pip install -r requirements.txtIssue: pip command not found
Solution: Use:
python -m pip install -r requirements.txtIssue: "TAVILY_API_KEY not found in environment"
Solution:
- Make sure you copied
.env.exampleto.env - Edit
.envand add your actual API keys (not placeholder text) - Restart your terminal/Python script
Issue: Stage 1 finds no events
Possible causes:
- Invalid category name (check available categories below)
- Tavily API rate limit reached
- Network connection issues
Solution:
- Use correct category names:
music,arts,food-and-drink,sports-and-fitness,health,business,science-and-tech - Wait a few minutes if rate limited
- Check your internet connection
Issue: Stage 2 processes very slowly
This is expected - GPT needs to visit each event page and extract information. Processing 10 events takes approximately 2-3 minutes.
Solution: Reduce --stage2-batch-size if experiencing timeout issues.
EventGenAI/
โโโ backend/
โ โโโ app.py # Flask API server
โ โโโ pipeline.py # Main pipeline orchestrator
โ โโโ profile_manager/ # User personality profiling
โ โ โโโ model.py # Embedding generation
โ โ โโโ prompt_builder.py # Prompt engineering
โ โ โโโ system_prompt.txt # LLM instructions for users
โ โโโ event_manager/ # Event data collection
โ โ โโโ tavily_search.py # Stage 1: URL collection
โ โ โโโ gpt_scraper.py # Stage 2: Detail extraction
โ โ โโโ event_types.py # Category definitions
โ โ โโโ event_embedding/ # Event personality modeling
โ โ โโโ event_model.py # Event embedding generation
โ โ โโโ generate_event_embeddings.py # Batch processor
โ โ โโโ system_prompt_event.txt # LLM instructions for events
โ โโโ filter_rankings/ # Recommendation engine
โ โ โโโ ranking.py # Cosine similarity ranking
โ โ โโโ google_geo.py # Geocoding utilities
โ โโโ response_generator/ # Natural language generation
โ โ โโโ generator.py # Explanation generator
โ โ โโโ system_prompt.txt # LLM instructions
โ โโโ test_validation/ # Testing & validation
โ โโโ event_embedding_sanity_check/
โ โโโ event_user_matching/
โโโ frontend/
โ โโโ index.html # User questionnaire interface
โโโ data/
โ โโโ search_results/ # Event data storage
โ โ โโโ all_events_master.json # Main event database
โ โ โโโ all_events_with_embedding.json # Events with embeddings
โ โ โโโ csv_files/ # Stage 1 outputs
โ โ โโโ gpt_responses/ # Stage 2 raw responses
โ โ โโโ raw_responses/ # Tavily raw responses
โ โโโ users/ # User profiles
โโโ .env.example # Environment template
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
โโโ ARCHITECTURE.md # Detailed system architecture
- ARCHITECTURE.md - Complete system architecture and design
- WEB_CRAWLER_SUMMARY.md - Web crawler documentation
When running Stage 1, you can choose from these categories:
music- Concerts, festivals, live performancesarts- Art shows, theater, exhibitionsfood-and-drink- Food festivals, tastings, dining eventssports-and-fitness- Sports events, fitness classes, marathonshealth- Wellness, yoga, meditation eventsbusiness- Networking, conferences, professional developmentscience-and-tech- Tech meetups, hackathons, science talks
Each category has multiple subcategories that are automatically searched.
- Start Small: Test with 1-2 categories first before running the full pipeline
- Monitor Progress: Stage 1 shows real-time progress; Stage 2 can be slow for large datasets
- Check Logs: Raw responses are saved for debugging - check
data/search_results/ - Batch Sizing: For Stage 2, use smaller batches (5-10) to avoid timeouts
- Regular Updates: Re-run Stage 1 periodically to get fresh events
- Kunlong Li (1007833025)
- Yuchen Zhou (1011816867)
University of Toronto - ECE1786 Course Project (2025)
Need help? Check ARCHITECTURE.md for system design details.