An intelligent VR app recommendation system for CMU Heinz College that combines RAG (Retrieval-Augmented Generation), knowledge graphs, and vector search to provide personalized Meta Quest VR app recommendations based on student learning goals.
The project includes a robust all-in-one startup script that handles everything:
# Start all services (Neo4j + MongoDB + Flask API)
./start_project.shWhat this script does:
- Checks Environment: Ensures Python dependencies are installed.
- Starts Databases: Checks for and starts Neo4j and MongoDB services.
- Cleans Ports: Automatically frees up ports 5000/5001 if they are in use.
- Launches App: Starts the Flask API server.
- Shows Logs: Streams the application logs to your terminal.
- Background Mode: Run
./start_project.sh --backgroundto start services silently and detach. - Force Restart: Run
./start_project.sh --force(or./restart.sh) to stop all running instances and restart fresh. - Status Check: Run
./status.shto view the health of all services. - Stop: Run
./stop_all.shto cleanly shut down all services.
- Chatbot Interface: http://localhost:5000/
- API Health Check: http://localhost:5000/health
- Neo4j Browser: http://localhost:7474
- Admin Dashboard: http://localhost:5000/admin (Login required)
For production deployment, use Docker Compose to run all services in containers.
- Docker & Docker Compose installed
- The
.envfile is already included in this repository with all required API keys and configurations
# Build and start all services
docker-compose -f docker-compose.prod.yml up -d --build
# View logs
docker-compose -f docker-compose.prod.yml logs -f
# Stop all services
docker-compose -f docker-compose.prod.yml down| Service | Container | Port | Description |
|---|---|---|---|
| vr-recommender | vr-recommender | 5001:5000 | Flask API with Gunicorn |
| redis | vr-redis | 6379:6379 | Rate limiting & caching |
| neo4j | vr-neo4j | 7474, 7687 | Knowledge graph database |
- Chatbot Interface: http://localhost:5001/
- API Health Check: http://localhost:5001/health
- Neo4j Browser: http://localhost:7474
# Rebuild after code changes
docker-compose -f docker-compose.prod.yml up -d --build vr-recommender
# View specific service logs
docker-compose -f docker-compose.prod.yml logs -f vr-recommender
# Check container health
docker ps
# Enter container shell
docker exec -it vr-recommender /bin/bash
# Remove volumes (reset data)
docker-compose -f docker-compose.prod.yml down -vThe system uses a RAG (Retrieval-Augmented Generation) pipeline:
- Query Understanding: LLM (Gemini 2.0) analyzes user intent.
- Vector Search (ChromaDB): Retrieves semantically similar skills/courses.
- Knowledge Graph (Neo4j): Traverses relationships (
VRApp->DEVELOPS->Skill).- New: Includes "Semantic Bridge" logic to connect unrelated terms.
- Ranking (LLM): Ranks candidates and generates transparent reasoning.
- Language: Python 3.9+
- Web Framework: Flask, Gunicorn
- Databases: Neo4j (Graph), ChromaDB (Vector), MongoDB (Data/Logs)
- LLM Provider: OpenRouter (Gemini 2.0 Flash)
- Data Collection: Firecrawl, Tavily
The system supports up to 16 concurrent requests via Gunicorn's threaded worker model.
| Setting | Value | File |
|---|---|---|
| Workers | 4 | web/gunicorn_config.py |
| Threads/Worker | 4 | web/gunicorn_config.py |
| Max Concurrent Requests | 16 | (4 × 4) |
| Request Timeout | 120s | web/gunicorn_config.py |
| MongoDB Pool | 10-50 connections | src/db/mongo_connection.py |
| Endpoint | Limit |
|---|---|
/chat |
10/minute |
/api/auth/login |
5/minute |
| Global | 200/day, 50/hour |
- Increase
workersingunicorn_config.pyfor higher traffic (recommended: 2× CPU cores) - Redis is used for distributed rate limiting across workers
- MongoDB connection pool auto-scales up to 50 connections
vr-recommender/
├── flask_api.py # REST API server
├── vr_recommender.py # Core RAG logic
├── start_project.sh # Main entry point
├── requirements.txt # Python dependencies
├── src/
│ ├── rag/ # RAG System (Retriever, Ranker)
│ ├── chat/ # Chat Session Management
│ ├── knowledge_graph/ # Neo4j Graph Builder
│ ├── vector_store/ # ChromaDB Vector Search
│ └── db/ # MongoDB Repositories
├── data_collection/ # Data Scraping Scripts
└── scripts/ # Maintenance Utilities
- Environment Variables: Stored in
.env(RequiresOPENROUTER_API_KEY,NEO4J_URI, etc.). - Updating Data: Use the Admin Dashboard (
/admin/data) to trigger scrapers or rebuild graphs. - Testing: Run
pytestor use the./diagnose.shscript for system checks.
MIT License - see LICENSE file for details.