Vibeleaderboard
← All Intel
Intel / post

LangChain's Paid Media Agent: Design Lessons and Measured Results

Source
x.com
Date
LangChain@LangChain

https://t.co/8enEvOGAlt

Context

LangChain's account of building an advertising-campaign is most useful for one measured lesson: the agent got faster, cheaper and easier to trust when arithmetic moved out of the model and into ordinary code. In its engineering post, LangChain says the first version of its weekly report loaded every campaign row, keyword and pipeline record into the model and asked it to calculate spend and week-over-week changes. On a frozen test set, one report consumed about 3.9 million input tokens, took 1,112 seconds and cost just over $3. Python now fetches the data, aligns date windows, calculates totals and applies fixed rules, and the model receives a compact set of results to interpret. LangChain says that change, together with removing unnecessary model calls, made an early reporting workflow about 40 times cheaper and 13 times faster, with runtime falling from 18 minutes to 85 seconds.

The same idea, keep the model's small and give it only what the task needs, runs through the rest of the design. The works as a map pointing to six folders of skills, which hold reusable instructions for doing the work, and a nineteen-page wiki of LangChain-specific facts such as what each campaign is for. Tools are handled the same way. Pipeboard's MCP exposes more than 200 ad-platform tools, and in June even LangChain's smaller read-only catalog took 38,000 tokens to load before the agent had read the question. Putting the catalog behind three tools, which search for a tool, read the selected tool's schema and run it, cut the first turn to about 12,000 tokens, which LangChain says was four times cheaper at the same judged quality. Rules that must always hold, such as not cutting a top pipeline driver after one bad week, are enforced in code so the model cannot override them.

The agent can propose campaign changes in Slack, but a person decides whether they happen. Only designated team members can edit or approve a change, the server checks Slack user IDs before accepting either action, and once a change is approved, code applies it and checks the ad platform to confirm it succeeded.

LangChain also reports business results: paid media went from 0 to 20% of its marketing pipeline in six months, cost per qualified lead fell 30% from June to August while monthly spend rose about 60%, and bringing analysis and reporting in-house instead of using an agency saves about $5,000 a month. These are LangChain's own figures for the paid-advertising program it started in January, and the post does not separate how much of them the agent itself produced. The engineering measurements are the better-supported part of the story. LangChain has open-sourced the agent, including its ad-platform tools, skills, a sample wiki and the approval workflow.

Terms in this piece · Glossary
  • AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
  • context window — The maximum amount of text a model can consider at once — its working memory for the current conversation or task.
  • system prompt — The standing instructions a model receives before any user input — defining its role, rules, tools, and tone for the whole conversation.
  • multi-agent — Using several AI agents on one problem — splitting work in parallel, checking each other, or filling different roles like planner and reviewer.
More from LangChain
Recommended reads
Comments

Checking sign-in…

Loading comments…