A Multi-Agent Architecture for Smarter Advertising
Key point
Spotify built a multi-agent system using ADK and Vertex AI to automate ad media planning.
Details
To solve the problem of workflows diverging by channel and surface even though Direct, Self-Serve, and Programmatic share the same backend, Spotify chose a multi-agent architecture instead of a centralized rule engine.
The core goal was to create a unified decision layer that takes a goal as input and resolves it through multiple tool calls and judgments. This layer was designed to handle budget allocation, inventory selection, and trade-offs like reach vs. efficiency and STR with the same logic regardless of whether it's invoked from Spotify Ads Manager, Salesforce, or Slack.
The initial use case was Media Planning, since it's the most complex area where sales, advertisers, inventory, pacing, and ad products all intersect. Users state campaign requirements in natural language, and the system generates an optimized media plan based on historical performance data.
The architecture is divided into role-specific agents.
- RouterAgent: quickly determines what information is present in the input message
- GoalResolverAgent: maps goals like REACH, CLICKS, APP_INSTALLS and ad categories
- AudienceResolverAgent: extracts targeting conditions such as interests, region, age, and gender
- BudgetAgent: converts budget expressions like $5000, 5k, €10,000 into micro-units
- ScheduleAgent: parses relative dates like "next month" and "30 days"
- MediaPlannerAgent: combines heuristics with historical performance data to optimize recommendations
The tech stack consists of Google ADK 0.2.0, Vertex AI (Gemini 2.5 Pro), gRPC, Google Cloud session storage, PostgreSQL + In-Memory Cache, and Apollo. Tool integration leverages FunctionTool and @Schema so the LLM can structurally understand tool parameters.
The optimization rules focus on judgments based on actual performance rather than simple generation.
- Keep cost metrics like CPM/CPC/CPI below historical medians
- Prioritize campaigns with delivery rates close to 100%
- Match successful cases with similar budget ranges and durations
- Score targeting overlap and diversity of format/goal combinations
- Automatically adjust the number of recommendations based on budget size: 1 for €0-1,000, 2 for €1,000-5,000, 3 for €5,000-15,000, 4-5 for €15,000+
The results were clear. Media plan generation time dropped from 15-30 minutes manually to 5-10 seconds, and input forms shrank from 20+ fields to 1-3 natural language messages. Agent response latency was kept to about 3-5 seconds through parallel execution.
Three lessons emerged from this process: prompts must be treated like code, agent boundaries determine both performance and maintainability, and tools are key to reducing hallucination and grounding responses in real data. Next steps include streaming responses, multi-turn refinement, A/B testing integration, and expanding into creative suggestions and competitive analysis.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.