Grocery reorder is one of the few agent use cases where the value is obvious and the failure modes are obvious. The value is the 30 minutes a week you do not spend rebuilding the same basket. The failure mode is a delivery slot showing up with a fortnight of yoghurt and a kilo of garam masala you ordered by accident.
This walkthrough covers a setup that prevents both. The agent learns your basket from history, drafts an order on a cadence you set, and places it only after the first month of confirmations. By month two it can run on autopilot for the routine items, with the long-tail (one-off ingredients, special occasions) still landing as a draft for you.
What this agent does
The agent reads your past 8 baskets on Instacart, Amazon Fresh, Blinkit, Zepto, or whichever delivery service you use. It builds a per-item cadence model: milk roughly every 7 days, eggs every 10 days, dish soap every 30, dental floss every 60. Then it watches the calendar; when an item is due, it goes into the next basket.
The output, every 7 days (or your chosen cadence), is a draft basket placed in a review board you open before the delivery slot. You add or remove items and confirm. The agent does not invent items. It does not browse the catalogue for "things you might like". It buys the household routine.
For the cluster context, see what an AI agent can actually do. For the closely related write-action pattern, see how to give agent multiple tools.
Where the basket comes from
Two source streams. Both matter.
- Basket history. The last 8 orders. The agent extracts each item, its quantity, and the date. From the dates it computes a cadence per item.
- Stable list. A household document (Notion, Google Doc, even a Google Sheet) where you maintain the staples. This is the source of truth for things that should always be in the cadence even if a recent basket missed them.
What the agent does not use: marketing emails from the grocery service, "trending in your area", or "people also bought". Those are recipe scope creep and will turn a 12-item basket into a 24-item one.
Cadence and timing
Cadence is per item, not per basket. The agent groups items by their next-due date and creates a single basket when enough items have come due. Most households end up with a primary weekly basket and a smaller monthly top-up.
Timing matters in two places:
- When the draft lands. 24 hours before your delivery slot. Earlier and you forget; later and you miss the cutoff.
- Skip rules. If you are travelling, the agent reads your calendar and pauses. If a basket would be tiny (fewer than 5 items), it consolidates with the next one.
For more on time-bounded agent behaviour, see how to restrict agent to business hours.
Guardrails and caps
Money guardrails are non-negotiable on a buying agent. Set them in the prompt, not in your head.
- Per-order cap. 1.5x your historical median basket. Drafts above the cap require explicit approval.
- Weekly cap. 2x your historical weekly spend. The agent stops drafting if the cap is approached.
- Single-item cap. No item above a per-item ceiling (most baskets stay under it; flags imported items, mistakes, or price spikes).
- Quantity sanity check. Quantity per item compared to last 8 orders. 3x or more triggers a flag.
- Allergens and dietary constraints. Hard rules. Reject the order rather than substitute.
For the broader spending control pattern, see how to set spending cap on agent.
Substitution rules
Out-of-stock decisions are where buying agents go off the rails. Pick a policy:
- Strict. Same brand, same size, or remove. This is the right starting point.
- Same category, cheaper. Allows the agent to swap to a cheaper or generic equivalent. Reasonable after a month.
- Smart sub. The agent uses past substitutions you accepted as training signal. Only enable after 60 days of clean history.
Review substitutions weekly. They are the single best signal for whether the agent's basket model has drifted.
Draft, then checkout
The first 30 days, every basket lands as a draft. You open it the day before delivery, check, edit, confirm. The first week of drafts is where the agent learns; expect to remove 10 to 20% of items.
After the basket has stabilised (week 4 or so) you can graduate to auto-checkout for the routine items only. The long-tail (special occasions, hosting, recipe ingredients you tried once) stays as draft.
For the broader graduation pattern, see how to limit agent actions and how to add a human approval step.
Common mistakes
- Auto-checkout from day one. The first month is calibration. You will catch a basket with double the right quantity at least once.
- No spending cap. Price spikes (a holiday week, a brand changing pack size) inflate the basket silently.
- Smart substitutions too early. The agent will substitute oat milk for cow milk, and it will be wrong.
- No skip rule. Travelling for two weeks and getting four deliveries you cannot accept is the most expensive mistake.
- Allergens as soft preferences. Hard guardrails. Reject the order, do not "try" to honour it.
Frequently asked questions
Can an AI agent actually order groceries for me on its own?
Yes, on platforms that allow programmatic checkout (Instacart, Amazon Fresh, Blinkit through their partner APIs, or via headless browser flows on others). The agent reads your basket history, builds a basket on a cadence, and places the order. The first 30 days the agent should send a draft basket for your approval before checkout; auto-checkout becomes appropriate after the basket has stabilised.
How does the agent know what to buy?
From two sources: your purchase history on the grocery platform (the last 4 to 8 baskets), and a household stable list you maintain (milk weekly, dish soap monthly, paper towels every six weeks). The agent intersects the two and adjusts based on your last delivery date and any items you flagged as "do not reorder".
What is a sane spending cap for a household grocery agent?
Set a per-order cap and a weekly cap. The per-order cap should be 1.5x your historical median basket, the weekly cap 2x your weekly historical spend. Anything above either threshold goes to draft for human review. Hard caps prevent both bugs and price shocks.
What happens when an item is out of stock?
The agent has a substitution policy you set: "allow only same-brand same-size", "allow same-category cheaper", "never substitute, just remove". The strictest setting is the safest while the agent is new. Substitutions are also a great audit signal; review them weekly to catch the agent learning bad habits.
Can the agent know about dietary restrictions and allergies?
Yes, but treat dietary constraints as hard guardrails, not soft preferences. Specify allergens in a structured allow-list/deny-list (no peanut products, no gluten, no shellfish), and reject the order if the constraint cannot be honoured. Soft taste preferences (prefer organic) are different and can be encoded as ranking signals.
Three takeaways before you close this tab
- Per-item cadence, batched into baskets. Not "weekly basket" thinking.
- Hard money caps, hard allergen rules. Both are non-negotiable.
- Draft for 30 days, then auto. The basket has to stabilise first.
Sources
- Instacart Developer Platform, "Catalogue and Ordering APIs", retrieved 2026-05-10, docs.instacart.com/developer_platform_api
- Amazon Web Services, "Amazon Fresh / WFM Order APIs reference", retrieved 2026-05-10, developer.amazon.com
- FDA, "Food Allergen Labeling and Consumer Protection Act", retrieved 2026-05-10, fda.gov/falcpa
- Aryan Agarwal, "Gravity household-agent guardrails", internal v1, May 2026, About