01Why AI agents get allergens wrong
Ask a menu chatbot whether the paneer butter masala is nut-free and it will usually answer confidently. Whether it is right depends on things the menu often doesn't say: the gravy is thickened with cashews, the naan is brushed with butter, the dessert is fried in ghee.
- The menu text is short and written to sell, not to list ingredients.
- Regional words carry the allergen: kaju is cashew, paneer and ghee are dairy, besan is chickpea.
- Missing information reads as absence: a dish with no allergens listed looks allergen-free.
- Recipes change, and the menu data doesn't always change with them.
A language model can read most of this, but it will also fill gaps with what dishes usually contain. For allergens, a plausible guess is the dangerous case.
02Give each allergen a definition and its words
Start with a fixed list of allergens the agent may use, rather than free text. For each one, write what counts as it in your catalog and the words that mean it, including the regional and trade names your kitchens actually use.
- tree nuts: any nut from a tree, in any form. Words: cashew, kaju, almond, badam, pistachio.
- dairy: milk from any animal and anything made from it. Words: paneer, ghee, butter, cream, khoya, malai.
- gluten: wheat, barley, rye and anything made from them. Words: maida, atta, naan, roti.
The words do most of the work. A dish whose description says "cashew gravy" is tagged tree nuts by a rule, for free, the same way every time. Only the dishes no word settles go to a model, which gets the same list and the definitions, and has to choose from them.
03Send the unsure ones to a person
Set a confidence threshold, and store nothing below it. A dish the model is 55% sure about is not tagged; it goes to a person with the model's guess and the text it read. A dish whose description says nothing useful, like a chef's special that changes daily, is marked unknown rather than guessed.
This is where most of the safety comes from. The agent never sees a guess presented as a fact, and the person deciding sees exactly what was uncertain.
04Exclude allergens in the query, and fail closed
When a customer says they are allergic to nuts, the agent should not be asked to remember that. The exclusion belongs in the search the agent calls: return only dishes known not to contain tree nuts.
Known is the important word. A dish nobody has decided yet is left out of a nut-free answer: unknown is never safe. The customer sees a shorter list, and every dish on it has a receipt saying how its allergens were decided.
05Keep it true when the menu changes
Allergen data goes stale quietly. A recipe changes, a supplier changes, a re-import drops a column. Two habits catch most of it: re-read the source on a schedule and re-tag only what changed, and compare each new version with the last one before it goes out.
The comparison worth an alert is a safety value carried by fewer dishes than before, which is also why a safety value should never be removed quietly. Dairy on 40% of the menu last week and 31% this week is either a real menu change or a lost tag, and a person should find out which before the agent does.
06How CloudCrane does it
CloudCrane tags allergens with a contract per field: allowed values, definitions and the words that settle each one, rules first and a model only for the rest, with anything below the threshold sent for review. Allergens are a safety field, so exclusions fail closed in the query and removed values wait for a person. A dataset read from a connected database can be synced on a schedule, with drift alerts before a changed version goes out. The result is a search tool an agent calls, with a receipt on every row.
07Questions
- Why do chatbots get allergens wrong?
- Menu text is short and written to sell, regional words like kaju and ghee carry the allergen, and a dish with no allergens listed looks allergen-free. A language model fills those gaps with what dishes usually contain, which is a plausible guess, and a guess is the dangerous case.
- Should an AI model decide allergens on its own?
- No. Let known words settle what they can, let the model choose only from a fixed allergen list for the rest, and send anything below a confidence threshold to a person.
- What should an agent do with a dish whose allergens are unknown?
- Leave it out of an allergen-free answer. A shorter list the customer can trust is better than a longer one with a guess in it.
- How do you keep allergen data current?
- Re-read the source on a schedule, re-tag only what changed, and compare each version with the last before it goes out. Alert when a safety value is carried by fewer dishes than before: it is either a real menu change or a lost tag.