Analytics and Recommendations - JRAdams472/LENA2 GitHub Wiki
Analytics & Recommendations
LENA quietly learns from how your household uses it and feeds that back into search results, recipe suggestions, and restock prompts. You never have to configure any of it — normal use is the training data.
Ranked search everywhere
Every search and picker — items, brands, ingredients, recipes, wine bottles, pantry — orders results by how likely you are to want them, not alphabetically. Roughly, the ranking tiers are:
- Favorites you've marked
- What your household uses — items picked in menus, grocery lists, and events
- What you've viewed or selected before
- Things matching terms you've searched for
- Everything else, alphabetical
On shared catalogs (items, recipes, brands) your own history outranks your household's, which outranks global usage across all households. Signals also decay over time — something you used last week counts for more than something from a year ago. With no history at all, results simply fall back to alphabetical, so nothing ever looks broken.
Every search you run and every pick you make records a small event, so the ranking keeps improving the more you use the app.
Recipe suggestions
The Dashboard's Delicious ideas for tonight card merges several recommendation sources and shows why each recipe appeared:
| Reason | Where it comes from |
|---|---|
| Similar to your menu | Ingredient overlap with recipes already on your meal plan |
| Due for a revisit | Good rating + long time since it last appeared on your menus |
| Matches your household's tastes | Categories your household picks most often |
| Trending in your household | Recent velocity — on your menus much more lately than historically |
Meal-type-aware recipe pickers
When you fill a meal-plan slot, the recipe list boosts recipes tagged with that slot's course — breakfast dishes rise in the Breakfast slot, dinner dishes in Dinner. Unknown or untagged recipes still appear, just lower down.
Restock suggestions
Set a minimum quantity on any pantry item (web Items page, Min Quantity field). When stock falls to or below it:
- the item appears under Time to restock on the Dashboard, and
- under Time to restock on your grocery list page, where Add drops it straight onto the list in the unassigned Other items group.
Suggestions need both low stock and signs your household actually uses the item — a one-off pantry entry you never touch won't pester you. Anything already on your latest list is filtered out, and rejected or still-pending catalog items never appear.
Checking items off matters
Grocery check-offs are recorded as engagement events. They're why "sugar" can outrank "flour" in restock suggestions — your checkout history is direct evidence of what your household burns through fastest.