Most anomaly detection fails in one of two ways. Static thresholds are predictable but miss anything they were not written for. A model asked to "find anything unusual" catches more but invents problems, and nobody can tell which flags to trust.
memosight runs both, in a fixed order, with a clear split between what code decides and what the model decides.
Layer one: rules
Every workspace starts with four rules. Each one is editable, and each can be turned off.
| Rule | Default trigger | High severity at |
|---|---|---|
| CTR drop | CTR 25% below its 14-day baseline, with at least 100 impressions | 40% below |
| CPA spike | Last 3 days 20% above the 7-day baseline | 40% above |
| Budget cap | Spend at 95% or more of daily budget | Always high |
| Impression share loss | Down 15 points over 7 days | Medium by default |
The minimum-impressions condition stops small numbers from raising false alarms. Without it, a campaign with 12 impressions and one click reports an 8% CTR, and its next quiet day reads as a collapse.
Today's partial data is excluded from every comparison, so a morning sync does not flag "spend down 70%" because the day is not over.
Custom rules in plain English
Teams can add their own rules by describing them in plain English. For example: "alert me when any brand campaign spends more than $500 a day with fewer than 5 conversions." The model turns that description into a structured rule that runs alongside the defaults. The description is screened before it reaches the model, and requests outside paid media analysis are refused and reported to workspace admins.
Layer two: the AI pass
When AI detection is turned on for a workspace, a second pass looks for patterns a single-metric threshold cannot express. Examples include spend rising while conversions fall, a slow decay that never crosses a threshold on any single day, or ROAS eroding across several campaigns at once.
Code does the arithmetic
Before the model sees anything, the worker computes statistics for each campaign and each metric (CTR, CPA, spend, conversions, impression share):
- the latest value and the baseline mean
- percentage change from baseline
- a z-score against the baseline's variation
- a streak: how many days the metric has stayed on the same side of the mean
Campaigns with fewer than seven days of data are skipped. The model receives these numbers and is told explicitly not to re-derive them. Language models are unreliable at arithmetic over long tables. They are much better at reading a set of signals and deciding which combination means something.
The model does the judgment, under constraints
The prompt includes everything the rules already flagged, with an instruction not to re-flag the same campaign and metric. It sets a floor: flag only when the absolute z-score is at least 1.5 or the change is at least 20%. It asks for fewer, high-confidence findings over many borderline ones, and allows an empty result. The model runs at temperature zero.
Output must be a JSON array with a fixed set of fields: type, severity, campaign, metric, detected and baseline values, deviation and reasoning. Anything missing a required field, or using one of the rule types, is discarded in code.
Every anomaly gets an explanation
A flag without context creates work. Each anomaly is saved with two or three sentences on what happened and one recommended next step. For AI findings this is the model's own reasoning. For rule findings it is generated from the metric, the current and baseline values, the deviation and the period.
From there, anyone can open the anomaly and ask follow-up questions. The analysis draws on the campaign's keywords, search terms, auction insights, media plan targets and search trends, and it ends with a concrete next step.
From anomaly to action
Open anomalies are part of the context for the action layer. A CPA spike on a campaign with rising wasted search terms is likely to produce a recommendation for negatives, and the anomaly appears in the reasoning.