Map the basket
Six essential UK food products are mapped through supply chain nodes and risk channels.
See how global shocks move through the UK food basket.
An independent prototype that maps six everyday UK foods to their supply chains, replays disruption scenarios such as grain export shocks and avian flu, and checks modelled pressure against ONS and Defra observed series.
From supermarket basket to global supply chain pressure.
Food Chain Lens lets users move from a basket item to observed movement, possible drivers, event windows, and evidence.
Project goal
Food prices do not move in isolation. A disruption in grain, energy, disease, imports, or logistics can move through farms, processors, distributors, and retailers. Food Chain Lens makes those modelled pathways visible.
Platform workflow
Six essential UK food products are mapped through supply chain nodes and risk channels.
Test grain disruption, energy spikes, avian flu, diesel shocks, and weather stress.
See where imported inputs enter the UK supply chain.
Compare model pressure with official ONS and Defra observed evidence.
Observed evidence
Evidence caveat: This validates direction and timing, not exact retail shelf prices.
Credibility and scope
Work with the project
Food Chain Lens is being developed as an independent food security intelligence prototype. If you work in food policy, retail data, commodity analysis, supply chain risk, research, or technology and want to discuss the work, suggest data sources, or explore collaboration, please get in touch.
Interactive prototype
Build a basket, follow a product pathway upstream, run a modelled shock scenario, inspect import origin exposure, or review directional validation evidence.
Official evidence currently supports upward pressure signals in the food basket, eggs, and milk during selected historical shocks. Three official series are connected. Three products are modelled only.
Build Your Basket
Choose the foods in a basket, compare the best available observed series over time, and see which supply chain pressure channels may explain the movement. This is an evidence based pressure view, not an exact supermarket receipt.
Quantities scale the upstream value for eggs and milk. Category index proxy products contribute directional movement only.
The default basket loads automatically using the best available observed series.
Estimating basket movement…
Directional explanations from the supply chain model and shock registry. Channel coverage shows how many basket products each channel touches.
Build a basket to read a text summary of the movement, coverage, and pressure channels.
Each product uses its best available observed series over a window anchored on the latest observation. Eggs (pence per dozen, Defra producer price) and milk (pence per litre, Defra farmgate price) produce quantity-scaled upstream GBP subtotals. Bread, chicken, potatoes, and pasta use ONS CPI category indices as directional proxy movement; no GBP value is invented for them. A pack of eggs is treated as 12 eggs. When the basket mixes price-level and index products, the headline movement is the unweighted average of each product's own movement and no basket GBP total is shown.
Calculation modes: price_level, mixed_price_and_index, index_only, synthetic_fixture_only (explicitly labelled demonstration data), and insufficient_data. Pressure channels map each product to shocks in the platform registry (for example grain_export_disruption, energy_price_spike, avian_flu, fertiliser_price_shock) through the supply chain graphs.
Read-only endpoints: /basket_cost/products,
/basket_cost/default, /basket_cost/estimate (POST),
and /basket_cost/summary. To light up real data, import the ONS
MM23 dataset with python -m gcmrp.jobs.import_ons_cpi path/to/mm23.csv
and Defra files with python -m gcmrp.jobs.import_product_prices.
Six essential UK food products. Verified rings show official evidence. Select a product to inspect.
Select a product in the constellation to see its exposure channels and evidence status.
Loading basket overview…
Click a node to understand how it may connect to basket movement.
Select a product to trace its supply chain pressure.
Pick a product on the left, or start from a basket card in the Food Basket Overview tab.
Choose a scenario below, or use the dropdown to model a custom shock.
Estimated price pressure across basket products from this shock.
Select this tab to load shared upstream exposure data.
Select an event to replay the model signal and compare with official evidence.
Select this tab to load data source status.
Food Chain Lens can now describe products through bounded product graph specs. This makes it easier to add new products consistently. Each spec must declare dependencies, evidence status, limitations, and confidence. Brand level graphs are possible later, but the current system does not claim exact retailer traceability, and it does not predict exact shelf prices.
Bundled example specs load with this tab.
Specs are pure data (YAML or JSON), strictly validated, and compiled into the existing supply chain graph structure. The format is bounded, not a programming language: fixed vocabularies and hard size and depth limits.
python -m gcmrp.jobs.import_product_specs examples/product_specs.
See docs/product_graph_spec.md for the full format guide.
Food Chain Lens can now connect product identity, open price observations, local research datasets, official index evidence, and future licensed sources through one retail evidence layer. Open Food Facts helps identify products. Open Prices and local datasets can provide reported price observations. Generated product graph candidates stay unreviewed until a human promotes them.
Reported observations are evidence, not live supermarket truth. Community sources are a community open dataset and not official retailer verified pricing unless the source says so. Brand and country labels are not supply chain proof. Generated candidates require human review. Licence and coverage limitations apply to every source.
Bundled example coverage loads with this tab.
Product identity: barcode, name, brand, quantity, categories, labels. A community open dataset — identity, not price, and not supply chain proof.
Community price observations linked to barcodes, with shop and date metadata where available. A community open dataset — not official retailer verified pricing.
Controlled local imports of historical retail price observations, including Kaggle style research datasets where the licence permits. Missing licence metadata adds an explicit limitation.
ONS and similar official indices stay validation benchmarks: category index evidence, not product level shelf price truth unless the data is genuinely granular.
A placeholder slot for future licensed data sources. Nothing is implemented until credentials, documentation, and licence terms exist.
Represented as a future source type only. No supermarket scraping is implemented in this version.
Represented as a future source type only. No accounts, no receipt photos, and no personal data collection.
Every source normalises into the same internal objects with a declared source type, evidence status, confidence, and limitations. Unit prices are normalised per kg, per litre, per egg, or per loaf where the quantity can be parsed; unknown quantities keep the original price and gain a limitation.
python -m gcmrp.jobs.import_retail_prices path/to/file.csv.
Generate unreviewed candidates from a local product export:
python -m gcmrp.jobs.import_open_food_facts_products examples/open_food_facts/sample_products.json.
See docs/retail_price_evidence_hub.md.
Where upstream food basket commodities enter the UK supply chain.
This layer shows UK import exposure by origin country based on UN Comtrade trade statistics. It does not claim exact retailer traceability. Import partner country does not always equal production origin.
Select the Global Origin Map tab to load origin data.
Schematic origin map based on import country weights. Data source: UN Comtrade.
Select a product and commodity to view import origin exposure and concentration analysis.
Food Chain Lens compares model pressure signals against official observed datasets. These checks confirm direction and timing, not exact shelf prices.
Pressure index, not retail price prediction. Static graph weights are expert estimates. Origin data shows UK import exposure, not exact retailer traceability.
Observed evidence timelines
Track how the best available observed series has moved over time for each basket product. Some series are producer or farmgate prices, while others are CPI category indices. These are evidence signals, not exact supermarket shelf prices.
Eggs and milk use producer and farmgate prices, which are not supermarket shelf prices. Bread, chicken, potatoes, and pasta use CPI category indices, which are not exact product shelf prices.
Click a point or event window to inspect movement.
Historical series loads with the Evidence and Validation tab.
This chart uses observed upstream or CPI proxy evidence, not exact shelf prices.
Select a product to read a text summary of the observed series, its source type, coverage, date range, latest value, and main caveat.
Each product maps to its best available observed series. Producer and farmgate prices are upstream prices. CPI category indices track a whole category against 2015=100. Synthetic retail fixtures are bundled demonstration data and never real market evidence. None of these are supermarket shelf prices.
| Product | Series | Frequency | Unit |
|---|---|---|---|
| Eggs | Defra egg producer prices | Quarterly | pence per dozen |
| Milk | Defra farmgate milk prices | Monthly | pence per litre |
| Bread | ONS bread and cereals CPI (D7D5) | Monthly | index, 2015=100 |
| Chicken | ONS meat CPI (D7D6) | Monthly | index, 2015=100 |
| Potatoes | ONS vegetables CPI (D7DB) | Monthly | index, 2015=100 |
| Pasta | ONS bread and cereals CPI as a labelled proxy (D7D5) | Monthly | index, 2015=100 |
python -m gcmrp.jobs.import_ons_cpi path/to/mm23.csv.
To load Defra egg or milk data, run
python -m gcmrp.jobs.import_product_prices path/to/file.ods eggs_producer_price eggs
(or milk_farmgate_price milk).
Read-only endpoints for this explorer: /price_history/products,
/price_history/summary, /price_history/{product_slug},
and /price_history/{product_slug}/sources. Retail evidence fixtures
from the Retail Price Evidence Hub can be selected as a clearly labelled
synthetic secondary source.
Food Chain Lens checks whether model pressure signals move in the same direction as official observed series during known historical shocks. This tests directional reliability and timing. It does not prove causality or predict exact shelf prices.
Reliability results load with the Evidence and Validation tab.
Food prices often respond months after an upstream shock. Each reliability check re-tests directional agreement after shifting the observed series by 0, 1, 3, 6, 9, 12, 14, and 18 months, then reports the best-matching lag. The best lag is descriptive, not a fitted parameter.
Observed sources are producer prices, farmgate prices, and CPI sub-indices — partial proxies, not supermarket shelf prices. A directional match shows the model pointed the right way at a plausible lag. It does not prove the shock caused the price movement and it does not forecast exact prices.
Reliability metrics load with the Evidence tab.
Official ONS and Defra series used to validate model direction and timing.
Observed CPI series validate direction and timing, not exact product shelf prices. This is directional validation only — not causal proof or quantitative prediction.
python -m gcmrp.jobs.import_ons_cpi path/to/mm23.csv.
Product level data may be farmgate or producer price data, not supermarket shelf price. This is partial product evidence only — not causal proof or exact retail price prediction.
date and value columns,
then run python -m gcmrp.jobs.import_product_prices path/to/file.csv eggs_producer_price eggs.
Select the Validation tab to load the validation report.
Creator and contact
Interested in food security, supply chain analytics, data engineering, or policy applications? I am open to feedback, collaboration, and internship conversations.