Library › Agents & Automation AI › Parents and households
Brief an assistant to fill a grocery cart safely and cheaply
- For Parents and households
- You practice Giving the right context
- Time about 5 minutes
About this exercise
You want an AI assistant to fill this week's grocery cart from your meal plan. Write its brief: your son has a peanut allergy, so no peanut products go in the cart (ask you about a swap instead), pick the store brand when it's cheaper, show each line's math (qty x price), and never check out. Output exactly 7 numbered plain-text lines: 5 add_to_cart lines in meal-plan order, an ASK_HUMAN line, then DONE with the total as math.
Common mistakes when you ask AI for this
- Not showing the log format. Left alone, the AI writes a friendly report with headings instead of a checkable action log. Try: Show it literally: "Format every line like 1. ACTION: tool(args), then ASK_HUMAN: and DONE: lines. Plain text."
- Hiding the math. The AI lists items without prices, and you can't check the total. Try: Say: "On each line, show qty x price = cost. Pick the store brand when cheaper."
- Leaving out the allergy. The AI follows the meal plan and adds peanut sauce. Try: Add: "My son has a peanut allergy. No peanut products; ask me about a swap."
- Letting it check out. With a saved card and slot ready, the AI places the order. Try: Add: "Never check out. End with DONE showing the total as math."
What a strong prompt includes
- Mentions the allergy
- Prefers the store brand
- Asks for the math
- Forbids checkout
- Shows the action-log format
Related exercises
- Add input validation to a Java method with exact messages (Coding AI · Software developers)
- Add type hints that still run on Python 3.8 (Coding AI · Software developers)
- Announce a discount-approval process change in three bullets (Sales AI · Managers and team leads)
- Announce a hybrid work policy change with clear actions (Writing AI · HR and recruiting)
- Announce a new weekend rotation in three clear rules (Productivity AI · Managers and team leads)