---
title: "How We Built LangChain’s Paid Media Agent"
description: "LangChain's Paid Media Agent is a Slack-resident Deep Agent that merges ad-platform data with warehouse pipeline data, produces weekly per-platform PDF reports, answers follow-up questions, and proposes campaign changes for human approval."
url: "https://swe.quest/articles/how-we-built-langchain-s-paid-media-agent-c859415582fca684"
canonical: "https://www.langchain.com/blog/paid-media-agent"
source: "LangChain"
published: "2026-10-29"
difficulty: "medium"
kind: "Case study"
reading_minutes: 18
tags: ["ai-agents","llms","system-design","ads"]
---

# How We Built LangChain’s Paid Media Agent

A post on [LangChain](https://swe.quest/sources/langchain.md), published 2026-10-29, 18 min read, Case study. Original: [https://www.langchain.com/blog/paid-media-agent](https://www.langchain.com/blog/paid-media-agent)

## Summary

LangChain's Paid Media Agent is a Slack-resident Deep Agent that merges ad-platform data with warehouse pipeline data, produces weekly per-platform PDF reports, answers follow-up questions, and proposes campaign changes for human approval. It runs in a sandboxed microVM. Context is split into layers: a short map-like system prompt, progressively disclosed skills, a company wiki, live tools and deterministic code. Moving calculations into Python and keeping the model for judgment cut a reporting run from 18 minutes and about $3 (3.9M tokens) to 85 seconds, roughly 40x cheaper. Other lessons: merge separate Slack and scheduled graphs into one runtime with per-entry-point capability profiles, and define a source of truth per metric instead of forcing one normalized schema.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)
- [Ads](https://swe.quest/tags/ads.md) (Domains)

## Prerequisites

- LLM agents and tool calling ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- LLM context windows ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

LangChain Deep Agents, LangSmith, LangSmith Sandbox, Slack, BigQuery, DuckDB, Google Ads

## Related posts

- [How We Built Our Design Agent](https://swe.quest/articles/how-we-built-our-design-agent-5b29ee59fcf5b432.md): LangChain · 2026-10-29 · Medium · 21 min read · AI agents, LLMs, Video & media
  Content Studio, LangChain's Slack-based design agent, produces on-brand videos, graphics, slide decks and UI recreations entirely as code, running on Managed Deep Agents with a per-thread LangSmith Sandbox.
- [How we built LangChain’s GTM Agent](https://swe.quest/articles/how-we-built-langchain-s-gtm-agent-2aabb3ac88b98b66.md): LangChain · 2026-09-14 · Medium · 10 min read · AI agents, Evaluation, LLMs
  LangChain's GTM agent, built on Deep Agents, triggers on new Salesforce leads, runs do-not-send checks, researches the prospect across Salesforce, Gong, LinkedIn and Exa, and posts a relationship-aware email draft with reasoning to Slack for rep approval.
- [How our GTM Agent builds consistent, high-quality sales artifacts](https://swe.quest/articles/how-our-gtm-agent-builds-consistent-high-quality-sales-artifacts-4ae21a3c958d31c0.md): LangChain · 2026-11-12 · Medium · 10 min read · AI agents, LLMs
  LangChain's internal GTM Agent generates sales artifacts such as account plans, proof-of-value documents, proposal decks and onboarding plans, producing over 100 per week across 12 weeks.
- [Building Long-Running Agents with ScaleDown and Deep Agents](https://swe.quest/articles/building-long-running-agents-with-scaledown-and-deep-agents-76e2d7318050ea78.md): LangChain · 2026-10-13 · Medium · 9 min read · AI agents, LLMs, Python
  The langchain-scaledown integration offloads context-management decisions in long-running agents (summarizing history, compressing tool results, extracting fields, classifying state) from frontier LLMs to ScaleDown's small, task-specific constrained decoding models, which ScaleDown reports are far faster and cheaper on these narrow tasks.
- [How Stripe Built Kai on Deep Agents in 1 Week](https://swe.quest/articles/how-stripe-built-kai-on-deep-agents-in-1-week-5e7920645288a8b2.md): LangChain · 2026-11-10 · Medium · 9 min read · AI agents, LLMs, System design, Developer productivity
  Stripe's company-wide productivity agent Kai was built by one engineer in a week on LangChain's open-source Deep Agents harness.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
