Projects · Consumer · AI Agents · Jun 2026

Shrinkflation Sleuth

An AI agent that turns 'this bag feels lighter' into the real price-per-ounce increase.

Same price, less bag

Doritos Nacho Cheese Tortilla Chips. When the bag shrank in 2022, the shelf price held at $4.99. The price per ounce did not.

Bag size, ounces 9.25 9.75 oz Price per ounce, cents 49.1 56.1 +5.4% at the same $4.99 2020 $4.79 2021 2022 $4.99 2023 2026 $5.19 Bag size, ounces 9.25 9.75 oz Price per ounce, cents 49.1 56.1 +5.4% at the same $4.99 2020 $4.79 2021 $4.99 2022 $4.99 2023 $5.09 2026 $5.19

Source: Shrinkflation Sleuth dataset. Size change per FullCarts.org. Shelf prices (bottom row) are representative, not live quotes.

An AI agent built in three days for the Google Cloud Rapid Agent Hackathon answers the one question the shelf tag won't. Across 29 documented size cuts, the average hidden increase was 12.2%.

The Problem

Shrinkflation is when a product gets smaller while the price stays the same. Capital One Shopping research estimates it has touched roughly a third of grocery items. Shoppers notice, but nobody can easily answer the one question that matters: how much more am I paying per ounce?

What I Built

An AI agent that answers that question with a number and a source. Ask “Has my Doritos bag gotten smaller?” and it finds the product, pulls its size and price history, checks the documented size change and its source, and reports the effective price increase, a severity rating, a consumer tip and one suggested next check.

It is one Google ADK LlmAgent on Gemini. Its instructions hold six playbooks: product lookup, brand investigation, category analysis, shopping-list audit, trend dashboard and data discovery. Gemini picks the playbook for each question. All data access goes through five read-only Elastic MCP tools: search, esql, list_indices, get_mappings and get_shards. It does not browse or scrape; it answers from a curated dataset in Elasticsearch.

The live demo is a Sleuth Explorer. Hosting the full agent publicly would mean exposing an Elasticsearch cluster and a Gemini key, so the explorer runs the same playbooks in the browser, without an LLM, over the exact JSON documents the agent queries. Each panel shows the tool calls the agent would make. It says so on the page.

How It Works

  1. Find the productA fuzzy full-text search over the product catalog in Elasticsearch, through the MCP search tool.
  2. Pull the historyOne ES|QL query returns size and price over time and computes the price per unit at every point.
  3. Cross-check the eventLook up the documented size change and its source. Reports that exist only on r/shrinkflation are flagged as unverified.
  4. ReportLead with the effective price increase, which is always larger than the shrinkage percentage when the price holds. Then severity, a tip and a next check.

In production, two Cloud Run services: the official Elastic MCP server image over HTTP, and this repo’s FastAPI app serving the ADK chat UI. Locally, the agent starts a roughly 70-line Python MCP server over stdio that exposes the same five tools. Only the connection parameters change.

Results

Dataset and outcomeValue
Products · brands · categories34 · 16 · 7
History records170
Documented size cuts (verified)29 (24)
Unchanged control products5
Average hidden increase across the 29 cuts+12.2%
Average shrinkage across the same cuts10.2%
Worst caseHaribo Goldbears, +25%
Tests35

What I learned building it:

  • One agent with playbooks beat a pipeline of agents. I first sketched a sequential agent (lookup, analyze, report). That forces every question through a product lookup, which is wrong for “which category is worst?” A single agent with explicit playbooks has fewer moving parts and no handoff failures, and the tool sequence still shows in the trace.
  • Agent quality is mostly instruction quality. Real multi-step behavior came from playbooks where each step’s output feeds the next, plus explicit error paths: zero hits, missing history, and one retry on an ES|QL syntax error.
  • Report the right metric. The sticker price hides shrinkflation. The price per unit exposes it.

Limitations

Correction

An earlier version of my resume described it as a multi-agent system that scraped retailers and used an Elasticsearch vector store. It is one agent. It does not scrape. It searches a curated dataset with Elasticsearch full-text search and ES|QL, and there is no vector store.

  • No quantitative evaluation of the agent. The six query types were spot-checked by hand. Answer quality and tool-call accuracy were never benchmarked.
  • Demo-scale data. Sizes, dates and sources follow public reports, but prices are representative, not live quotes, and points between documented events are interpolated.
  • The original Elastic Cloud cluster has been shut down. Running the agent means loading the data into your own cluster.
  • The explorer imitates Elasticsearch. Its search mimics multi_match with fuzziness, so edge cases can rank differently.
  • A reproducibility bug, now caught. The pipeline was documented as deterministic but derived product codes from Python’s per-process salted hash(). A test now regenerates the data and fails if the committed files drift.

What I’d Do Next

  1. Benchmark the agent. A labelled set of questions with expected tool calls and answers, scored on every change.
  2. Replace representative prices with real price captures, so the hidden-increase numbers come from receipts rather than estimates.