Use case · Supermarkets and grocery · Loyalty first
AI in a grocery chain.
A worked example.
Supermarket loyalty schemes hold one of a chain’s most valuable assets: years of data on what households really buy. This illustrative scenario starts there, with shopper groups, offers that fit and habits over time, then looks at fresh food, promotions, availability and pricing. Try the demo to see how it works.
An illustrative scenario. The chain is invented and every figure on this page is made up.
Which offers go to which shopper groups, and which fresh products to mark down this afternoon.
Marketing and the store manager
What groups of shoppers do we have? →
What a grocery chain typically deals with
I've assumed the following for this example. In a real engagement the first job would be to check what is actually true for you.
Fresh food on a clock
Produce, bakery, dairy and fish have to sell quickly. Order too much and it is thrown away; order too little and the shelf is empty.
Promotions every week
Many offers run at once, and it is hard to tell which ones really paid back once the discount is counted.
Shoppers who compare prices
A small group of everyday items, such as milk, bread and eggs, shapes how people judge the whole shop. Being out of line on those matters more than on the rest.
Many stores, many questions
Store and category managers want quick answers, while reports queue up behind a small data team.
Loyalty data that is under-used
Most chains already run a loyalty scheme, so there is a detailed record of what households buy. Too often it is used for points and the odd mailing, not for understanding shoppers.
An island market
Most stock arrives by sea with long lead times, demand swings with the tourist season, and a small market means every price move is noticed quickly by competitors.
Turning loyalty cards into decisions
Every card scan is a small record of how a household shops. AI can find the natural groups hiding in that data, describe them in plain English, and suggest offers that suit each group. Marketing stays in charge of what is sent and to whom.
- Shoppers are grouped by how they actually behave: how often they visit, how much they spend, how much fresh food and how many promotions they buy
- Each group gets a plain-English profile, for example "big weekly shop" or "convenience top-up"
- Groups update as habits change, so the picture never goes stale
- Each group is matched to the categories it buys more of than average
- Win-back offers for regular shoppers who have gone quiet, aimed at what they usually buy
- Offers are tested on a small group first, then widened to the ones that work
- Delivered through the channels you already use: app, email and till receipts
- Which categories are growing or shrinking, and which groups are driving it
- What is bought together, for placement, bundles and promotions
- Seasonal swings, including tourist-season demand
- Early signs of shoppers switching to a competitor
Where the data comes from: your loyalty platform and till data, connected read-only, with each shopper identified by an anonymous ID rather than a name. Where AI helps most: finding the groups, explaining them in plain English, and drafting offer ideas for marketing to review.
Meet the shoppers found automatically in 1,200 made-up loyalty shoppers
Finding the groups…
Ask the loyalty data
Prepared questions on made-up sample data. In a real setup an AI assistant turns your own wording into queries like these, using your agreed definitions, and your team reviews the results. The SQL shown is what actually runs here, in your browser, and the shopper groups are found by a clustering method that runs here too.
Choose a question above to see how it works.
Basket analysis: what really goes together
Every till receipt is a small story about one shopping trip. Read across hundreds of thousands of them, and especially the ones tied to a loyalty card, the baskets show what goes together, what kind of trip it was, and which products bring people in.
Placement, bundles, ranging
- Products bought together far more than chance
- Where to place them, and what to bundle
- Which products are quietly holding up the sales of others
The reason behind the shop
- Quick top-up, meal for tonight, big weekly shop, a party
- Different trips need different offers, stock and checkouts
- Linked to loyalty groups, it shows who does which trip
Promotions, thought through
- If one product goes on offer, which others rise with it
- Which offers just move sales from one product to another
- Which products draw shoppers in, even at low margin
Try it on made-up baskets
Workflows: from a repeated decision to a routine
A workflow takes something your team does again and again and runs the routine part by itself. Something triggers it, AI gathers and reads the data and drafts the next step, a person approves, and the outcome is logged and checked afterwards. People keep the decisions and lose the chasing.
A worked example · Afternoon fresh markdown, store by store
Every afternoon each store has fresh food that will not sell by closing. This workflow finds it, proposes a fair markdown and tells the right shoppers. All names and figures are made up.
At 15:00 each day the workflow starts for every store.
Stock with today and tomorrow use-by dates, sales so far, the forecast to closing and the waste history are pulled for each store.
AI spots what is at risk. In Store 07: 38 packs of chicken breast with use-by tomorrow, 22 sourdough loaves and 14 salad trays, all forecast to sell only about 60% by closing.
A markdown for each product, kept above the agreed minimum margin: chicken 30% off, bread 40% off after 18:00, salad 25% off. A matching app offer is drafted for the Convenience top-up and Deal seekers groups who often visit Store 07 after 17:00, using anonymous IDs only.
The store manager reviews the list on their phone, lowers the chicken to 25% off and approves the rest.
Shelf labels are queued for printing and the app offer is scheduled. The next morning, waste and margin are compared with a normal day and logged.
The same routine can handle a bakery sell-through, a fish counter, short-dated dairy or seasonal stock after a holiday.
Getting your data ready for AI
AI is only as good as the data it can see. Loyalty cards, tills, stock, suppliers and invoices rarely line up on their own. The first job is reaching all of them and shaping them into one version people trust. AI does a lot of that work, quickly, and leaves a record of every change.
Many sources, one view
- Tills and loyalty-card data: read-only connections, shoppers kept as anonymous IDs
- Stock, waste and availability: read-only connections on a schedule
- Supplier invoices and price lists: PDFs and spreadsheets read by AI, whatever the layout
- Competitor prices: AI-assisted web collection from public pages and leaflets
- Promotion plans: the planning files and tools already in use
- Online orders and app: where the chain has them, read like any other source
AI does the heavy lifting
- Same thing, different spellings: matched to your master lists (stores, products, suppliers, loyalty customers)
- Dates, currencies, units and number formats brought into one standard
- Duplicates found and removed, including the same record arriving from two systems
- Gaps filled from another source where one exists, and listed where not
- Odd values spotted and explained, never silently changed
- Documents, emails and photos read and turned into rows: supplier invoices, delivery notes, price lists, shelf photos
One layer people trust
- Definitions written down once and used everywhere
- Refreshed automatically on a schedule, nobody exports anything
- Every cleaning step logged, so any number can be traced back to its source
- Access limited to what each person needs
- A new source can be added without rebuilding what already works
Watch messy data get cleaned
Forecasting: a simple model that scales to any slice
Knowing what is likely to sell, store by store and category by category, turns into better ordering, less waste and the right people on the right days. The model in this demo is deliberately simple: take what happened at this time last year, then adjust it for how the last eight weeks are running compared with the same eight weeks a year ago. To test it, the most recent eight weeks are hidden, forecast, then compared with what really happened.
Try it on made-up history
Any dimension you can name
Store, category, product, format, region, supplier, day of the week, loyalty group. The same model runs on each slice, and each gets its own accuracy test. Add a dimension and the forecasts follow.
From a handful to thousands
The table above is already forecasting dozens of slices at once. The same approach covers every product in every location, by day or by hour where that is what the decision needs.
Start simple, add what helps
Where the extra effort is worthwhile, richer models can bring in promotions, price changes, weather, events and holidays. The pipeline around the model stays the same, so it can be swapped without rebuilding.
- Order fresh stock by store so there is less waste and fewer gaps
- Staff tills, bakeries and delis for the busy days
- Plan Easter and Christmas volumes by category well ahead
Seven more places I would look
Small, useful and kept under control. Each one is a candidate for a first pilot, not a promise.
Answers without the queue
Store and category managers ask in plain English ("which stores dipped last week?") and get an answer built on agreed definitions, with the query visible and a person able to check it.
Order closer to demand
Compare what was ordered with what really sold, store by store and day by day, so orders match demand and less fresh food is thrown away.
Offers that pay back
See which promotions earned more once the discount is counted, and which mainly moved sales around or cost margin.
Fewer empty shelves
Spot lines that keep running out before shoppers notice, with a pointer to the likely cause: ordering, delivery timing or shelf-filling.
Faster routine tasks
Drafting weekly summaries, supplier messages, store updates and promotion reviews, with good habits for what to check and what never to paste into a tool.
Build reports faster, safely
AI assistants help the data team write and document reports and pipelines, with code review and testing kept in place.
Smarter price reviews
Read several signals together, gathered automatically from your own systems and from public sources: our prices and margins, competitors' public prices, and how much stock we hold and how fast it sells. The result is a short weekly list of products worth a price review, starting with the everyday items shoppers compare most. The decision stays with people. More on pricing below.
Using stock and competitor prices to decide where to look
In grocery, small price moves add up across thousands of products. AI can read several signals at once and point to the products, especially the everyday items shoppers compare most, that deserve a second look. The price itself is still a human decision.
- Our prices, costs and margins: pulled automatically from your existing systems (tills, ERP, pricing files) through read-only connections
- Competitors' prices: collected automatically from public sources, using AI-assisted web scraping of competitor websites, licensed price-data services, or AI reading photos from shop visits
- Stock and sales speed: straight from your stock and till systems on a schedule, so nobody has to export anything
- Promotions and results: from the planning tools or spreadsheets you already use
- Business rules: minimum margin, price-match promises and brand rules, written down once in plain language
Where AI helps with collection: reading messy web pages, matching similar products across shops, filling gaps, and flagging when a source changes or breaks.
- A short weekly list of products to review, with plain-English reasons, for example "priced above competitors, a lot of stock, selling slowly"
- The everyday items shoppers compare most, and where we are out of line on them
- A safe range for any change, never below the agreed minimum margin
- A follow-up check on whether a change helped
- The decision to change a price
- Judgement about brand, customers and local competition
- Exceptions and local knowledge
- Approving anything before it reaches a shelf
Where AI adds most: matching similar products across different shops, making sense of messy price data, and explaining the results in plain English. A sensible start is a weekly list of suggestions, widened as the team gets comfortable.
The demo below includes two pricing questions, using made-up products and made-up competitor prices.
The rest of the demo: from a question to a checked answer
The loyalty questions are in the section above. These cover sales, fresh food, promotions and pricing. Pick a question and you'll see the definitions it relies on, the query, the answer and the checks. The data is invented: 14 stores, 8 product categories and 8 weeks of sales, plus fresh-food waste, shelf availability, six promotions, 24 products with made-up competitor prices, and 1,200 made-up loyalty shoppers.
Prepared questions on made-up sample data. In a real setup an AI assistant turns your own wording into queries like these, using your agreed definitions, and your team reviews the results. The SQL shown is what actually runs here, in your browser.
Ask the sample data
Choose a question above to see how it works.
A proposed approach
Offered as a starting point to discuss, not a fixed plan.
Understand before building
- Which decisions are slow, and who makes them
- How fresh ordering, promotions and pricing work today
- Which definitions people already agree on, and where they differ
A first pilot could look like
- Scope: Fresh-food markdowns in a few stores
- Data: stock with use-by dates, sales and waste
- You would get: an afternoon markdown list for each store manager
- How we would know: we compare it with similar stores and days
Leave the team able to run it
- Clear ownership of the definitions
- Simple guidance on what to check and when to stop trusting a result
- A decision on whether, and how far, to widen it
What keeps it safe and useful
- Definitions agreed once, by finance and operations, and used everywhere
- Read-only access to a prepared layer of data, so a mistake can't change anything
- People in the loop: results are checked, and unusual ones are investigated, not assumed
- Customer data kept anonymous: shoppers appear as IDs, and access is limited to what each person needs
- Queries visible and logged, so any answer can be traced and questioned
- Tested before it is trusted: checked against questions where the answer is already known
Questions before any proposal
- Which three decisions would you most like to make faster?
- How are fresh orders decided today, and how much is thrown away?
- How do you judge whether a promotion paid back?
- Who watches competitor prices today, and how?
- How is your loyalty data used today, and who owns it?
- Which pricing rules must never be broken (minimum margin, price-match promises, brand rules)?
- What must never leave your systems or be pasted into an AI tool?