Field note · 5 min read

    A catalog that can't forget an allergen

    How a shared, cross-restaurant dish catalog saves repeated AI work, and why its allergen data is only ever allowed to grow.

    5 min read4 sectionsWritten from shipped code

    01The same dish, over and over

    Gobbles reads restaurant menus from photos, spreadsheets and typed lists, then enriches every dish with ingredients, allergens, spice level and more. Many dishes appear on many menus. Enriching "Paneer Butter Masala" separately for every restaurant would waste time and money, and could produce slightly different answers for the same dish.

    02One key per real dish

    The catalog identifies a dish by its normalised name plus whether it's vegetarian. Normalising means lowercasing, stripping punctuation and collapsing whitespace, so "paneer butter masala!!" and "Paneer Butter Masala" resolve to the same entry.

    Restaurant A · Paneer Butter Masalaenriched
    Restaurant B · paneer butter masala!!cache hit
    Restaurant C · Paneer Butter Masalacache hit
    Live demo · Three restaurants, one enrichment

    Every stage checks the catalog first. A hit is reused immediately, with no AI call.

    03Allergens are merged, never replaced

    Sharing data raises the stakes: a bad update could remove an allergen for every restaurant at once. So when a catalog entry is updated, allergen sets are merged in the database. A later run can add an allergen; it can never take one away.

    catalogdairytree_nuts
    new runtree_nutsdairy

    Merged, not replaced. Dairy stays.

    Live demo · A new run that misses dairy can't erase it

    04The other guardrails around it

    • A fixed 14-class contract with regional synonyms, so "paneer" and "ghee" map to dairy and "maida" maps to gluten.
    • Conservative extraction: when the model is unsure, the allergen is included.
    • Anything outside the allowed vocabularies is dropped rather than stored.
    • Allergens are kept out of the embedding text, so a "dairy-free" search can't match dairy dishes by wording.
    • A restaurant's manual correction locks that item against automatic overwrites.

    Don't make the model your safety system

    An AI coach should never recommend an exercise that hurts someone. Here's how to enforce that without trusting the model to remember.

    Read next