Meerkats AI
Use casesExisting data stack
Use case 03 · Existing data stack

A skincare brand already had the data stack. Now its AI agents read it, and scale or pause campaigns inside its rules.

A D2C skincare brand · warehouse, dbt and a semantic layer already in place · one workflow

The brand had done the data work: a warehouse with dbt models, a semantic layer with the KPI definitions finance signed off, dashboards everyone trusted. Its AI agents read none of it. They called the ad platforms directly, judged campaigns on platform ROAS, and suggested changes nobody dared apply. We built the context layer on the stack they already had, without redefining a metric, and added the pieces that were missing. Now an agent tells profitable campaigns apart by finance's definition and scales or pauses them inside rules the growth lead set.

The situation

  • The warehouse, the dbt models and the semantic layer were in good shape. Finance trusted every number on the dashboards.
  • The agents didn't read any of it. They pulled the ad platforms' APIs and the store directly, got ROAS on each platform's own window, and never saw returns, product cost or shipping. “Profitable” meant whatever the platform said.
  • The warehouse refreshed overnight. A campaign that spent its day's budget by 10 AM looked fine until the next morning.
  • The scaling policy lived in a doc: scale winners in steps up to a ceiling, pause anything under the margin floor for three days, never touch a launch campaign. The agent had never read it, so people checked every suggestion by hand, and then stopped reading the suggestions.

Before the agent could act, it had to know

The agent could reason and use tools from day one. It became reliable once this list was written down: which information to trust, what the terms mean, which rules apply, and what it is allowed to do.

Before the agent could…It had to know
Call a campaign profitable
  • Margin after ad spend, by finance's definition, straight from the semantic layer
  • Returns and product cost from the warehouse models
  • Each platform's full attribution window, so a two-day-old campaign isn't judged yet
Scale a campaign
  • Today's spend against the daily budget, as of this hour
  • The step size and the ceiling from the rule
  • That the campaign isn't a protected launch
Pause a campaign
  • How many days it has sat under the margin floor
  • Stock on the products it sells, because a pause on an out-of-stock product is a different decision
  • The before state, so it can be resumed
Change anything above its ceiling, or on a protected campaign
  • Nothing. It can't. It stages the plan for the growth lead.

What they already had, and what we built on it

Where a system already gave the agent what it needed, we used it as it was. We built only what was missing.

They hadIt already gave the agentWe built
A warehouse and dbt models
Trusted, modelled business data
Read as they are, as the source of truth. Plus an hourly read of what the warehouse doesn't hold: spend so far today, stock cover
A semantic layer with KPI definitions
The agreed meaning of margin, contribution and ROAS
Agent access to those same definitions, and one meaning per term across three ad platforms. Nothing copied, nothing redefined
Dashboards
Analysis built for people
The metric behind each chart, in a form the agent reads
A written scaling policy
The rules people followed
The same rules as conditions the agent checks before any action runs
SSO and warehouse roles
Permissions for people
An agent identity with read rights on the models and write rights on two actions. The growth lead can revoke it in one place
Platform and pipeline logs
A record of what ran
A trace per decision: inputs with sync time, the rule, the action, the read-back, and the outcome a week later

The system, layer by layer

01Data & integrations
The warehouse's dbt models as the source of truth, synced on its schedule. The ad platforms read hourly only for spend so far today, and written to through two actions. The store and inventory for stock cover.
02Semantic layer
The brand's own. Margin after ad spend, contribution, ROAS and each platform's attribution window, mapped once onto the definitions finance already owns. We point at it. We don't redefine it.
03Context layer
Each campaign tied to the products it sells, their stock and margin, and its launch or protected status. The scaling policy as rules. The state per campaign: days under the floor, spend today, the last change the agent made.
04Stateful workflows
One automation on an hourly cadence: profitability and pacing together. It remembers what it changed on each campaign last run, so it never scales the same campaign twice in an hour.
05AI agents & actions
Two registered actions: scale a budget within a step and a ceiling, and pause a campaign with its before state kept. Everything else the agent can do is read-only.
06Governance & traceability
Inside the rule it runs on its own. Above the ceiling, or on a protected campaign, it stages a plan for the growth lead. Every run is recorded, and the outcome is checked a week later.

How a campaign gets scaled, or paused

  1. ScheduleEvery hour the agent reads spend so far today per campaign from the platforms, and margin after ad spend per campaign from the semantic layer, on each platform's full window.
  2. ContextFor each campaign it loads the products it sells, their stock cover, its launch or protected status, how many days it has sat under the floor, and what the agent changed last run.
  3. DecisionCode applies the rule, not the model. Over the margin floor for the window, with stock cover and headroom under the ceiling: a scale candidate. Under the floor for three days, not protected, not out of stock: a pause candidate.
  4. ActA scale within the step and the ceiling runs. A pause runs with the before state stored. Above the ceiling, or on a protected campaign, the plan goes to the growth lead with the evidence.
  5. VerifyThe platform is read back. The change, its source rows with sync time, and the rule that allowed it go on the record.
  6. OutcomeA week later the agent checks the result against what the plan expected, and the record is updated. The growth lead sees which rules are earning their keep.

The automation, in outline

{
  "automation": "profitable-pacing",
  "schedule":  "hourly",
  "metrics":   { "margin_after_ads": "semantic:…", "spend_today": "live:…" },
  "context":   ["campaign.products", "stock.cover", "campaign.protected", …],
  "condition": { … },
  "plan":      ["campaign.budget.scale", "campaign.pause"],
  "policy":    { "step": "…", "ceiling": "…", "requires_approval": ["above_ceiling", "protected"] }
}

Each stateful automation is a typed contract: a trigger, a condition, the context it may read, the registered actions in its plan, and its policy. The model fills fields. Our code validates, resolves and binds. A person approves what the policy says needs approval. The full contract carries more than we show here.

Who can do what

  • The semantic layer stays the owner of every definition. When finance changes the margin formula, the agent's next run uses it. Nothing is copied into the agent.
  • Scaling runs inside a step and a ceiling per campaign per day. Pausing needs three days under the floor. Both numbers live in the rule, where the growth lead can change them without touching the agent.
  • Launch campaigns are protected. A pause on an out-of-stock product is a different decision and goes to a person.
  • The agent's identity reads the models and writes two actions. Nothing else. Revoking it takes one change in one place.

Bring us one workflow. We’ll start there.

We connect the systems you already run, write down what the agent must know before it acts, and start with recommendations before actions. The next workflow reuses what the first one built.