Every product eventually wants an "insight" feature. Recommendations, trends, comparisons, summaries — features that turn raw user data into conclusions. The hard part is not computing the conclusion. The hard part is resisting the temptation to show a conclusion when the data does not actually support one.
PriceMemory, an offline-first Android price memory and budget app, gave this problem an unusually concrete shape. Its headline insight — *which store you systematically overpay at* — is exactly the kind of feature that most implementations get wrong, because the naive version of it is a few string comparisons and a percentage away from fabricating savings.
This post documents the rules that gate the feature, why each rule exists, and the general lesson for any product that derives conclusions from user-entered data.
The naive implementation is a lie generator
The obvious implementation of "which store is cheaper" looks like this:
- Fuzzy-match item names entered by the user.
- Compare average prices across stores.
- Multiply the difference by an assumed purchase frequency and show an annual saving.
Every step quietly corrupts the result. "Milk 1L" and "milk" may or may not be the same product. Averages hide the fact that the two prices were recorded six months apart at different package sizes. And the annual projection compounds a two-observation difference into a confidently wrong number. Users remember confident wrong answers far longer than honest caveats, and the app's entire value proposition — *it remembers prices* — collapses if its memory is untrustworthy.
Rule 1: Canonical matching, not string matching
Price comparisons operate on a canonical item, not on raw text. "Milk 1L" and "milk" resolve to the same product; "Organic Milk" does not. This distinction is deliberate:
- Under-matching (treating "milk" and "Milk 1L" as different) silently starves the feature of data, so users conclude "this app never shows anything."
- Over-matching (treating "Organic Milk" as "milk") produces comparisons between different products, which is worse than no comparison — it is a confidently wrong comparison.
Canonical identity is a domain-modeling problem, not a search problem. It has to be decided at write time, when the user is present and context is available, rather than guessed at read time from old rows.
Rule 2: A data-sufficiency threshold
A comparison only appears when the same canonical item has been logged at two or more different stores within the last 30 days. Two properties of this rule matter:
- Recency bounds staleness. Prices drift. A comparison built on months-old observations answers a question the user is no longer asking.
- The threshold is per item, not global. Having extensive data for bread says nothing about the reliability of a coffee comparison. Sufficiency is evaluated at the level the conclusion is drawn.
Below the threshold, the app does not show a grayed-out guess. It says, plainly, *log the same item at two stores to see comparisons.* Showing nothing with an explanation is a feature; showing a weak comparison is a bug.
Rule 3: Show the evidence, not just the conclusion
Every comparison carries the exact dates and the exact amounts behind it. The user is never asked to trust a derived number without being able to inspect the rows that produced it. This does two things: it makes the conclusion auditable, and it teaches the user what data the app needs more of.
Rule 4: A floor for "different", and no projections
If two stores' prices differ by less than 5%, the app reports "prices are similar" instead of a saving. Small differences are noise: rounding, promotions, unit conversions. Reporting them as savings trains the user to distrust the feature.
And the app never extrapolates. No "you'd save ₹12,000 a year!" — that number requires assuming purchase frequency, price stability, and behavior change that no logged data supports. A bounded, verifiable statement ("you paid 40 more at Corner Store over 3 purchases this month") is strictly more useful than an unbounded invented one.
The general lesson
Any feature that derives conclusions from user data needs the same four gates:
- Identity rules decided before comparison, not inferred during it.
- Sufficiency thresholds evaluated at the same granularity as the conclusion.
- Evidence always attached, so conclusions are auditable.
- Noise floors and an explicit refusal to extrapolate beyond observed data.
The deeper pattern: an insight feature is a small reporting system, and reporting systems need the same discipline as any other system boundary — explicit inputs, explicit validity rules, and an honest empty state. When there isn't enough data, saying so *is* the correct output. An app that would rather show nothing than invent something is an app users can eventually trust to be right when it does speak.