Article

# How the action layer works

From a synced account to an applied change: the eight analysis passes, the fixed action vocabulary, the snapshot taken before every change, and how rollback actually undoes it.

**Decision Foundry** · October 30, 2026 · 9 min read

The action layer is the part of memosight that turns analysis into changes on a live ad account. It is also the part where a mistake costs real money. So most of its design is about constraint:

- what the model may propose
- what gets filtered out before a person sees it
- how any change can be undone

This article walks through one cycle, from a data sync to an applied and reversible change.

## 1. A sync starts the cycle

Each workspace runs on a schedule, daily or every four hours. The worker pulls the latest campaign, ad group, keyword, search term, ad and audience data from the ad platform, lands it, and runs [anomaly detection](https://memosight.com/resources/how-anomaly-detection-works.html). Recommendation generation starts once the data is fresh, so actions are never built on yesterday's numbers when today's are available.

## 2. Eight passes, each with its own context

Instead of one large prompt asking "what should we change?", the worker runs eight category-specific passes. Each one gets only the data relevant to its question:

| Category | Looks at | Can propose |
| --- | --- | --- |
| Campaign health | Status, spend, conversions, open anomalies | Pause or enable campaigns and ad groups |
| Budget optimization | Pacing, days near budget cap, plan targets | Budgets, target CPA, target ROAS, bidding strategy |
| Keyword analysis | Keyword performance and status | Add, remove, pause or enable keywords |
| Quality score | Keywords with the lowest quality score | Keyword bid adjustments |
| Search query mining | Search terms that spend without converting | Campaign and ad group negatives |
| Ad creative | Ads ranked by CTR | Pause or enable ads |
| Audience intelligence | Audience, device and location segments | Bid modifiers |
| Time optimization | Performance by hour and day | Ad schedule bid modifiers |

Narrow context produces better recommendations. A pass about wasted search terms does not need auction insights, and leaving them out keeps the model on the question.

## 3. Root cause first, then a fixed vocabulary

The model is instructed to reason like a paid media strategist accountable to a media plan: find the underlying cause before recommending anything. Poor CPA might come from audience inefficiency, bid structure, creative drag or low-intent traffic, and each of those calls for a different change.

What it can recommend is fixed. There are 25 action types, from `set_budget` and `add_negative_kw` to `set_device_bid_modifier`, and each category is limited to its own subset. Anything outside that list is discarded. Every recommendation must carry four things: the current value, the proposed value, the reasoning and the expected impact. The executor needs the current value to find the resource and to build the rollback.

When a media plan is uploaded, gaps between committed targets and actuals become the first priority. A campaign that is under-pacing against its plan is treated differently from one that is simply cheap.

## 4. Filters before anyone sees it

Model output goes through checks in code before it reaches the actions queue:

- **Status conflicts.** A recommendation to pause something already paused, or enable something already running, is dropped.
- **Duplicates.** If the same change is already pending, the new one is dropped.
- **Recent dismissals.** A recommendation dismissed in the last 14 days is not re-suggested.

The result is a short queue of changes that are new, possible and different from what the team has already rejected.

## 5. Approval and the snapshot

When someone approves an action, the executor does four things in order:

- Loads the action and the ad account's credentials, which are kept in a secrets manager and never in the application database.
- Reads the current state of the resource from the ad platform and saves it as a **rollback snapshot**.
- Applies the change through the platform's API.
- Marks the action as applied and stores the snapshot with it.

The snapshot is taken from the live account at the moment of change, not from the last sync. If someone edited the campaign by hand an hour ago, the snapshot reflects that.

## 6. Rollback restores the exact earlier state

Rolling back re-applies the snapshot through the same API. For changes that create something, such as a new keyword or negative, the executor stores the resource name the platform returned and deletes exactly that resource on rollback. For removals, the snapshot holds enough to re-create what was removed.

Values are also checked against platform limits on the way in and on the way back. Bid modifiers, for example, are clamped to the range the platform accepts. A stray proposal or an unset value in a snapshot cannot produce an invalid write.

## What is live today

The executor runs against Google Ads today. The recommendation model and guardrails are platform-agnostic, and connectors for other channels are on the roadmap. For the autonomy modes and guardrails that decide how far an agent may act on its own, see [From answers to actions](https://memosight.com/resources/answers-to-actions.html)

## See it on your own warehouse.

We will map your models to definitions and show where the gaps are.

[Book a demo](https://memosight.com/index.html#contact)

## Keep reading

[

Article8 min read

### How anomaly detection works

Rules you control catch the known failure modes. An AI pass looks for what thresholds miss. Code does the arithmetic, and the model only does the judgment.

Read article

](https://memosight.com/resources/how-anomaly-detection-works.html) [

Blog6 min read

### From answers to actions

How recommendations turn into budget and bid changes, the two autonomy modes, and the guardrails that decide how far an agent can go.

Read post

](https://memosight.com/resources/answers-to-actions.html)

---
Source: https://memosight.com/resources/how-the-action-layer-works.html
