Mar 2024 - Apr 2024 · OpenSoft General Championship (Gold Medal)
OpenSoft Movie DB
Gold Medal, OpenSoft General Championship, IIT Kharagpur.
The gold-medal entry in IIT Kharagpur's OpenSoft General Championship. It runs as three services: a React front end with Google sign-in, a paid Gold tier, and Alan AI voice navigation; a FastAPI catalog API; and a dedicated search service that fuses BERT vector search with full-text search using reciprocal rank fusion. TF-IDF recommendations, a weighted related-titles score, and aggressive Redis caching keep it instant over a large catalog.
Architecture
The problem. A movie catalog has to feel instant over a large dataset, and search has to handle both exact titles and vague, descriptive queries, all while staying watchable across uneven connections.
Search two ways, then fuse. A fuzzy full-text query handles keywords and typos while a BERT vector search handles meaning, and the two rankings are fused with reciprocal rank fusion so both 'the matrix' and 'a film about dreams within dreams' land well. Autocomplete, recommendations, and related titles each have their own tuned query.
Fast, and personal. Redis sits in front of nearly every read so pages return instantly, TF-IDF recommendations rank the catalog against what you liked, and a single MongoDB aggregation builds the related-titles row.
Sign in, go Gold, talk to it. Google OAuth ties watchlists and comments to an account, a paid Gold tier unlocks playback, and Gold members get hands-free Alan AI voice navigation over an adaptive HLS player.
What I built
- Built a hybrid search service that fuses BERT vector search and fuzzy full-text search on MongoDB Atlas with reciprocal rank fusion, gated by query length.
- Added TF-IDF content recommendations and a weighted, single-aggregation relevance score for related titles, with Redis caching in front of nearly every read.
- Layered Google OAuth, a paid Gold tier, and hands-free Alan AI voice navigation onto a React front end with an adaptive HLS player.
- Kept the catalog fast with Redis caching applied uniformly across three services over a MongoDB Atlas database with search and vector indexes.
Under the hood
The stack, the data structures, and the decisions that matter, for engineers.
BERT vectors and full-text, fused with RRF
Full search lives in a dedicated search service. Every movie plot is embedded once with a sentence-transformers BERT model and stored as a vector on the document; at query time the same model embeds the query and an Atlas $vectorSearch finds the nearest plots, while in parallel an Atlas $search fuzzy compound query ranks by keyword with the title boosted over cast and directors. The two rankings are merged with reciprocal rank fusion, summing 1/(rank + penalty) from each list and re-sorting, and the service gates them by query length, so a two-word title leans on keywords while a long descriptive query leans on the semantic vector. Every result is Redis-cached by query.