The Case for a Multi-Agent Architecture
Traditional monolithic services or rule engines struggle with a specific class of problems: Combinatorial Complexity. Advertising campaign planning is a multi-stage decision-making process involving goal definition, targeting, budget allocation, and scheduling—all with interdependent variables. Each stage applies subtly different rules across channels (Direct, Self-Serve) and surfaces (Web, Mobile, internal tools).
In such an environment, cramming all logic into a single AI model is a maintenance and scalability nightmare. Instead, an Agentic Approach, where specialized agents collaborate, offers a solution. It modularizes complexity, enables parallel execution, and ultimately projects consistent decision-making across all channels. This article delves into the design philosophy and implementation details of a multi-agent system applied in a real-world service. You can find the detailed source material on the Spotify Engineering Blog.

Core Design: Defining Agent Roles and Boundaries
The success of an agent architecture hinges on how you define the boundaries between agents. Over-segmentation increases orchestration overhead, while too few agents creates a monolith. Our key principle in practice was: one agent, one clear responsibility.
Agent Decomposition Structure
- RouterAgent (Traffic Controller): Quickly analyzes natural language user input to determine what information is present. If only 'budget' and 'duration' are mentioned, it avoids calling goal or targeting agents, saving unnecessary LLM calls and cost.
- Specialized Resolution Agents:
GoalResolverAgent: Maps vague intents like 'increase brand awareness' to quantifiable campaign objectives (REACH,CLICKS).AudienceResolverAgent: Translates phrases like 'music lovers in their 20s' into demographic data and interest taxonomy.BudgetAgent: Normalizes various budget formats ('$5k', '€10,000') into internal system units.ScheduleAgent: Parses relative date expressions ('next month', 'for 30 days') into concrete date ranges.
- MediaPlannerAgent (Optimization Engine): The core agent that synthesizes all resolved information. It uses a heuristic-based optimization engine backed by thousands of historical campaign performance data points to recommend optimal ad sets.

Practical Implementation: Tools and Prompt Engineering
The most critical aspect was enabling agents to make decisions grounded in real-world data. We achieved this by leveraging Google ADK's FunctionTool to provide existing ad services and databases as tools.
Benefits of a Tool-Based Approach
- Prevents Hallucination: Agents generate recommendations by accessing real data (geo target lists, ad categories, historical performance).
- Integrates Existing Systems: Instead of building new backends, we utilized already-validated APIs as tools, ensuring rapid implementation and stability.
Managing Prompts as Code
Prompt engineering became a part of software engineering. A small wording change can dramatically affect output consistency. Our key learnings:
- Explicitly Specify Output Format: Force agents to respond only in a predetermined format like JSON or a specific template.
- Provide Concrete Examples: Include examples of 'good' and 'bad' responses within the prompt to guide the model.
- Build Multi-Layer Defenses: Implement validation and fallback logic at the output parsing stage, in addition to guidance within the prompt.

Conclusion: The Impact of an Agentic Architecture
This multi-agent system reduced media plan creation time from 15-30 minutes to 5-10 seconds and cut required user inputs from 20+ form fields to 1-3 natural language messages. More importantly, it established a data-driven decision-making culture. Every recommendation is now backed by thousands of historical performance data points, not human intuition.
The true value of this approach lies in the centralization of complexity. When a new optimization logic or business rule emerges, instead of modifying workflows across multiple channels one by one, you only need to update the central agent platform, and it applies consistently everywhere. This is the cornerstone of a sustainable architecture that reduces tech debt and accelerates product evolution. Future work includes streaming responses, multi-turn refinement, and A/B testing integration.