From-Scratch Build · Recommendation Systems
A content-based recipe recommender that learns what you like to cook from the ingredients and tags of recipes you enjoy — not from star ratings. It builds a taste profile and ranks unseen recipes by how close they sit to it.
What it is
Recipes carry their meaning on the surface: an ingredient list, a cuisine, a handful of tags. That makes food a natural home for content-based recommendation — you can describe why two recipes are similar without a crowd of other users. Savory turns each recipe into a TF-IDF vector over its ingredients and tags, builds a cook's taste profile as the centroid of what they liked, and ranks new dishes by cosine similarity to that profile.
Because the signal is the recipe itself, Savory can recommend a brand-new dish nobody has rated yet, return "more like this" for a single recipe, fall back to a diverse popular list for a brand-new cook, and optionally use MMR to keep results from collapsing into five near-identical dishes. Every recommendation comes with a plain reason: the ingredients it shares with what you already like.
Try it
The real engine is the Python package in this repo (savory/, scikit-learn TF-IDF + cosine, 12 passing tests). This in-browser demo loads the same committed data/recipes.json and reimplements the identical math in JavaScript so you can play with it here. Numbers match the Python output.
Loading the recipe dataset…
The method
240 synthetic recipes across 10 cuisines, each with ingredients, tags and prep time. Deterministically generated, committed as JSON.
Ingredients + tags + cuisine become content tokens; TF-IDF down-weights staples like onion and garlic.
A cook's profile is the L2-normalised centroid of the vectors of recipes they liked.
Rank unseen recipes by cosine similarity to the profile; already-liked items are excluded.
Optional Maximal Marginal Relevance trades a little relevance for variety.
No likes yet? Return popular recipes spread across cuisines so a new cook gets a sensible, diverse list.
Architecture
Turn every recipe into a TF-IDF vector over its ingredient, tag and cuisine tokens.
Average the vectors of the recipes a cook liked into a single taste profile.
Score the catalogue by cosine similarity to that profile.
Optionally re-rank with MMR so the list isn't all the same dish.
Return the best unseen recipes, each with the ingredients it shares with your likes.
Reflection