Skip to content
プロジェクト

概要

Open-source paid media agent for Google Ads, Meta Ads, Reddit, LinkedIn, X, and OpenAI Ads: analysis, reports, and reviewed changes, built on Deep Agents.

AI・機械学習

この数値の測り方

計測したスター増加

24時間
0
7日間
+2
15日間
+10
1か月
+27

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

LangChain

Paid Media Agent

A paid-media analyst for your team's Slack.
Built on Deep Agents. Deploys with Managed Deep Agents.

License: Apache 2.0 Python 3.12+ Built on Deep Agents Deploy with Managed Deep Agents

Deploy to your team's Slack → · Try it locally, no keys needed · Deploy guide · Docs

Paid Media Agent setup console layered with an illustrative Slack report showing spend, leads, cost per lead, and platform comparisons

Setup console · Report illustration with example figures.

Ask it in Slack what changed across your ad accounts, and what to do about it. Paid Media Agent compares campaigns across Google, Meta, LinkedIn, TikTok, Reddit, X and more, explains the movement with the numbers behind it, sends weekly and monthly reports, and drafts budget or status changes for a person to approve. It deploys to your LangSmith workspace with Managed Deep Agents in a few commands.

Live ad account changes are off by default. Turning them on takes a reviewed write policy, release checks, and an authorized approver. An approval covers the exact proposal reviewed; an edit needs a new one.

Deploy to your team's Slack

This repository is a Managed Deep Agents project, so it deploys as it is. You need a LangSmith account, a model key, and a Pipeboard token for your ad accounts (it has a free plan). In your own terminal:

curl -fsSL https://raw.githubusercontent.com/langchain-ai/paid-media-agent/main/install.sh | bash
cd paid-media-agent
uv run paid-media-agent config set LANGSMITH_API_KEY ANTHROPIC_API_KEY PIPEBOARD_API_TOKEN
uv run paid-media-agent accounts discover --add
uv run paid-media-agent mda deploy --yes
  • The installer gets uv if you need it, clones the repository, and installs its dependencies.
  • config set asks for each key without showing it. Use a LangSmith personal access token (lsv2_pt_...).
  • accounts discover --add maps every ad account your Pipeboard token reaches to an alias.
  • mda deploy --yes checks the project, then deploys it, sandbox and Slack app included.

The first deploy asks which Slack app to use and prints a link to install it in your workspace; a workspace admin may have to approve it. Then message the app under Apps in Slack, or /invite it to a channel and mention it. The deploy guide covers each step, what ships, the LangSmith Gateway, and test copies.

Or ask your coding agent. Paste this into Claude Code, Codex or Cursor, from any folder:

Deploy LangChain's open-source paid media agent to my Slack workspace with Managed Deep Agents.

1. Install it with `curl -fsSL https://raw.githubusercontent.com/langchain-ai/paid-media-agent/main/install.sh | bash`, then work in the `paid-media-agent` folder it creates.
2. Read `AGENTS.md` and follow the `paid-media-onboarding` skill. Ask me its setup questions in one message.
3. Tell me which keys you need. I'll type them myself with `uv run paid-media-agent config set <KEY>` in my terminal; never ask me to paste a key in chat.
4. Run `uv run paid-media-agent demo --with-proposal`, then `uv run paid-media-agent mda check`, and fix what it flags. Read me its warnings.
5. Have me run the first deploy, `uv run paid-media-agent mda deploy --yes`, in my own terminal: it bills, builds the agent's sandbox and sets up the Slack app. Ask me before later deploys.
6. When it's live, walk me through messaging the agent in Slack and asking a first question about last week's spend.

Once the repo is open, say what you want. AGENTS.md routes each request to a step-by-step skill. It never asks you to paste a key into the chat.

Say It will
"Deploy it to our Slack." check the install, tell you which keys to enter, connect your accounts, and hand you the deploy command after your yes
"Add our business context." draft your goals, conversions, and campaign conventions from your briefs, and ask only what's missing
"Make the reports match our brand." update the report design and renderer together
"Connect our X Ads account." add the direct adapter's keys and map the account

What it does

  • Compares campaign performance across connected accounts: spend, conversions, cost per lead, return on ad spend, and budget pacing, in each account's currency.
  • Investigates changes. It finds the campaigns behind a shift, checks the supporting data, and flags gaps that could change the conclusion. Missing data is never treated as zero.
  • Sends reports. Weekly and monthly reports run on a schedule and post their summary to the Slack channel you choose. The full report, with charts, campaign tables, and recommendations, renders as HTML.
  • Prepares changes for review. It drafts a budget or status change with the reason, the risk, and how to measure and reverse it, and waits for an authorized person to approve.
  • Works in the background. Long multi-account pulls and full reports go to read-only helpers on the model it picks for each task, and it answers in the same thread when they finish.
  • Comes back later. Ask it to check how an approved change did in two days, and it schedules its own check-in.

How it works

Paid Media Agent is a Deep Agents agent deployed on Managed Deep Agents, which runs the Slack app, a sandbox per thread, schedules, background helpers, and tracing. The model decides what to investigate; code computes every metric and checks every report figure against the source data.

  • Slack. Each step shows above the reply while it works ("Reading Google Ads campaign performance"), and the reply ends with helpers running, minutes taken, and an estimated cost.
  • Ad platforms. Pipeboard connects Google Ads, Meta Ads, LinkedIn Ads, TikTok Ads, Pinterest Ads, Snap Ads, Reddit Ads, and Google Analytics; X Ads and OpenAI Ads use read-only direct adapters. Host code holds the credentials and account ids; the model sees aliases.
  • Skills and a wiki. Analysis, reporting, and change workflows are skills, and a paid-media wiki covers attribution, platform differences, benchmarks, and budget decisions. Your business context sits beside them.
  • Background helpers and check-ins. Helpers are async subagents with read-only tools, each on the model the agent picks for its task. They send the agent progress notes, and an urgent one wakes it. Check-ins are one-time schedules on the thread.
  • Writes. Mutations run only through a typed proposal, a persisted approval of that exact proposal, one attempt, and a readback.

Read the architecture, or start changing it: instructions.md · workspace/skills/ · Customization · Operations.

Try it locally

The demo runs a scripted analysis and a simulated budget change against synthetic accounts. It needs no keys, calls no model, and touches no live campaign:

uv run paid-media-agent demo --with-proposal

With a model key in .env, ask a real question or render a report:

uv run paid-media-agent ask "Which campaigns had the largest increase in cost per lead last week?"
uv run paid-media-agent report --cadence weekly

uv run paid-media-agent setup opens a local console for the same setup: model, accounts, and deployment, in your browser.

Make it yours

Want Add Guide
Your goals, conversions, and naming workspace/skills/company-context/ paid-media-org-onboarding skill
Your report style DESIGN.md and the renderer tokens Report design
Where and when reports post PAID_MEDIA_REPORT_SLACK_CHANNEL, PAID_MEDIA_REPORT_TIME, PAID_MEDIA_REPORT_TIMEZONE, and the report days Operations
Another model PAID_MEDIA_MODEL and its key, or the LangSmith Gateway Models
Warehouse or CRM data a read-only tool in the shared assembly Optional data sources
Live changes a write policy and the release gates Live-write runbook

Settings live in .env, account aliases in config/accounts.toml, and company context in workspace/skills/company-context/. All three are Git-ignored. Redeploy with uv run paid-media-agent mda deploy --yes after a change.

Questions

What does it cost? The code is free (Apache 2.0). You pay your model provider and Pipeboard (free for 2 ad accounts). Managed Deep Agents hosting is paid. A Slack reply that did work ends with its estimated model cost.

Can it change my campaigns by itself? No. Live changes are off until an operator enables them, every change needs an authorized person's approval of the exact proposal, and the kill switch (paid-media-agent writes kill-switch on) stops them all.

Which models? Claude Opus 5.5 by default. OpenAI, Google, any OpenAI-compatible endpoint, and the LangSmith Gateway work too; PAID_MEDIA_MODEL_EFFORT sets reasoning effort. Background helpers can run on a different model per task, with its key in .env; PAID_MEDIA_HELPER_MODEL sets their default.

Do I need Slack? No. Use LangSmith Studio (uv run mda dev), the deployment's API, or the terminal (paid-media-agent ask). Background helpers and check-ins need Managed Deep Agents.

PDF reports? On Managed Deep Agents reports are HTML: the managed build installs core dependencies only. The self-hosted Docker image includes WeasyPrint, so reports there are HTML and PDF.

Can I run it on my own servers? Yes. Self-hosting runs the same agent with Docker, Postgres, an HTTP API, and your own Slack app:

uv run paid-media-agent config generate PAID_MEDIA_API_TOKENS PAID_MEDIA_APPROVAL_SIGNING_KEY
docker compose up -d --build

Apache 2.0 · Changelog · Security · Contributing · Code of conduct

関連プロジェクトを探す

読み込み中…