// the find
groveco/content-engine
A very simple content-based recommendation engine. Great for learning, but also ready for real-world use.
A minimal Flask REST service that recommends similar products using TF-IDF and cosine similarity on text descriptions, with precomputed results cached in Redis. Aimed at people who want to see a content-based recommender end-to-end without wading into a bigger ML framework.
The core logic in engine.py is short enough to read in five minutes and actually understand what TF-IDF + cosine similarity is doing, which is the whole point if you're learning. Precomputing similarities in /train and just looking them up in /predict is the right split for a read-heavy recommendation workload. Comes with a sample CSV and curl examples so you can see it working in under a minute.
Last pushed in January 2021 and pinned to Anaconda plus a Heroku conda buildpack that's effectively unmaintained territory now — expect friction getting a working environment. Only one file of tests, no coverage of the Redis-backed prediction path or edge cases like unknown item IDs. It's called 'production-ready' but there's no auth beyond a hardcoded-looking API token check, no input validation on the CSV, and no handling for the /train endpoint being hit while a stale cache is still being served.