Grocery Cart Agent
Automating grocery delivery by separating the jobs to be done
I subscribed to a meal kit for a while, but was frustrated with the strict weekly format and the lack of being able to cook a big batch meal.
Grocery delivery is a service that exists, but assembling web carts feels like it can take almost as long as going to the store and shopping with a physical cart.
But it's 2026 🙂
I started by pointing Codex at the Whole Foods website through Playwright, but it was slow! So I shifted more of the responsibilities to the deterministic playwright harness, and simplified the generative decision responsibilities to simply taking in just the available items and returning which product to buy.
From a systems perspective, I separated responsibilities into different agents:
- Job 0 — Recipe creation (Punted): You can paste in your favorite recipes or ask your own chatbot to generate them for you.
- Job 1 — Turning recipes into a shopping list: Consolidating repeated ingredients across multiple meals and showing a checklist to skip items already in your pantry.
- Job 2 — Doing the shopping: Given a shopping list, the harness fills the cart based on the model's inference.
Get the source at palmeryan/grocery-cart-agent.
I did some light hardening, but it does expose your agent to the web, so use at your own risk. Also amazon may or may not be happy about this sort of automation. Enjoy!
Grocery Cart Agent Architecture
query
cards
context
click
retry / skip
response
check