Find similar songs from a library of 2.2 million tracks. Select any song and get instant recommendations powered by Word2Vec embeddings and vector similarity search.
Each song has a 32-dimensional Word2Vec embedding that captures its musical characteristics. When you pick a song, FAISS finds the nearest vectors in that embedding space and returns the closest matches. MongoDB stores the song metadata and handles text search for the search bar.
- Flask -- Python web framework serving the API and frontend
- MongoDB -- stores song titles and artists, powers the text search
- FAISS -- vector similarity search across 2.2 million embeddings
- NumPy -- embedding loading and L2 normalization
- Word2Vec -- pre-trained 32-dimensional song embeddings
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtPlace the two data files in the data/ directory:
meta_word2vec_2M.tsv-- song titles and artistsemb_word2vec_2M.tsv-- 32-dimensional embeddings
Build the index (run once, takes about 1 minute):
python build_index.pyStart the app:
python app.pyOpen http://localhost:5000.
Type any song title or artist name to get suggestions.
| Endpoint | Description |
|---|---|
GET /api/search?q= |
Search by title or artist |
GET /api/recommend?id=&n= |
Get similar songs (max 50) |
GET /api/random |
Get 12 random songs |
Search for Eminem songs:
curl "http://localhost:5000/api/search?q=eminem"Get random songs:
curl "http://localhost:5000/api/random"


