In a nutshell
The Consumer-Price Index (CPI) is a measure that examines the weighted average of prices of a basket of goods and services that are of primary consumer need (e.g., housing, food, transportation, and medical care).
Changes in the CPI are used to compare costs of living over time and to identify periods of inflation or deflation. For example, the UK’s Office for National Statistics (ONS) publishes a monthly annual inflation rate to keep track of inflation in the UK.
Governments use the CPI to inform their policy decisions (e.g., how much benefit to offer as part of a welfare system).