DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to find the campaigns behind a cost-per-lead increase with Paid Media Agent

Ask plain-language questions about performance changes and get the campaigns behind them.

Who it is forA performance marketer who notices a drop in lead efficiency and needs to know which campaigns caused it.

The problemCost per lead can shift for many reasons across several accounts, and finding the cause by hand means comparing many campaign rows.

The outcomeA ranked answer naming the campaigns behind the change, with supporting data and any data gaps that could change the conclusion.

What you need first

  • Python 3.11+ and uv installed
  • Git installed to clone the repo
  • Access to the ad platforms you use, through Pipeboard MCP or direct adapters for X Ads and OpenAI Ads
  • A model key for the ask command and a chosen model for setup
  • A LangSmith organization with MDA access, an API key with deployment permissions, and a model key for managed deployment

Steps

  1. git clone https://github.com/langchain-ai/paid-media-agent.git
  2. cd paid-media-agent
  3. uv sync
  4. uv run paid-media-agent setup to choose a model and connect your ad accounts
  5. uv run paid-media-agent ask "Which campaigns had the largest increase in cost per lead last week?"

Prompt for your agent

Use the paid-media-agent repo to ask which campaigns in <target account> had the largest increase in cost per lead last week. Expected output: a ranked list of campaigns with the source, date window, and data-quality flags. Verify that each campaign's cost per lead change can be traced to the source platform data.

Caveat. The ask command uses your configured model, so answers depend on that model's reasoning and on the quality of the connected platform data.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page