In the rapidly evolving landscape of Generative AI, many organizations remain stuck in the "prototype trap," where impressive demos fail to translate into stable, production-ready systems. Spotify, however, has successfully moved beyond the experimental phase. By implementing a robust, multi-agentic architecture within its Ads Manager platform, the company has transformed how audio advertising is created, managed, and delivered at scale.
Pratik Rasam, a senior engineer at Spotify Ads, recently detailed the company’s transition from a monolithic AI experiment to a sophisticated, distributed agent ecosystem. Today, more than 70% of ad creatives on the platform are generated using AI, totaling over 20,000 unique creatives for 7,000 advertisers. This shift represents not just a technological upgrade, but a fundamental change in how software teams own, monitor, and deploy intelligence.
The Chronology of an Agentic Shift
The journey to Spotify’s current "Ads AI" platform began roughly 18 months ago. Initially, the team relied on a single, monolithic agent—a "mammoth" of an instruction set tasked with everything from copywriting and script generation to audience resolution and guardrail enforcement.
"It worked, but it was brittle," Rasam explained. As the team added more requirements, the system became increasingly prone to hallucinations and difficult to debug. The team realized that in order to scale, they needed to adopt a "single agent, single package, single owner" philosophy.
By late 2025, the team had transitioned away from the monolith toward a modular architecture. They implemented a system where individual teams own specific agents, complete with their own dependencies, monitoring, and PagerDuty alerts. This change allowed Spotify to move from a "research demo" phase to a production-grade architecture, leveraging frameworks like Google Cloud’s Application Development Kit (ADK) to orchestrate complex, multi-step agent workflows.
Anatomy of the Multi-Agent Architecture
Spotify’s Ads AI platform operates on a clear separation of concerns. The architecture is built on three pillars: safe content, a modular agent platform, and flexible integration.
The Agentic Stack
At the core of the platform is a gRPC service layer that handles session management and orchestration. Individual agents—such as the Ad Script Generation Agent, the Ad Guardrail Agent, and the Audience Recommendation Agent—reside within this layer. Importantly, Spotify enforces safety and orchestration at a separate, centralized layer rather than embedding it within the agents themselves. This ensures that guardrail policies remain consistent, regardless of which agent is performing the creative work.
Ownership and Visibility
A critical design choice was the enforcement of Bazel visibility at the horizontal layer. If one agent, such as the Ad Script Generation Agent, requires the Audience Resolver, it cannot access it unless the audience team explicitly grants import permission. This compile-time enforcement prevents cross-team dependency issues and ensures that ownership remains clear. Every agent package includes:
- lib-info: Defining the owning team.
- Monitoring-info: A YAML configuration for dashboards and alerting.
- AgentFactory/Adapter: Scaffolding for dependency injection.
Supporting Data: Why Multi-Agent?
The motivation for moving to a multi-agent system wasn’t just to follow industry trends; it was a response to both supply-side technological improvements and demand-side complexities.
On the supply side, the maturity of JSON parsing, schema validation, and standardized observability (OTel GenAI conventions) has made it possible to treat agents as deterministic, reliable software components. On the demand side, Spotify recognized that campaign creation is rarely a linear process. Advertisers often initiate a campaign on a mobile device, refine it on a desktop, and finalize it via an API. Stitching this context together requires a multi-agent approach that maintains a shared session state across different touchpoints.
Key Performance Metrics
- Ad Generation: Over 20,000 creatives generated.
- Scale: Over 7,000 active advertisers using the tools.
- Adoption: 70% of current ads utilize AI-driven tools.
- Efficiency: The system significantly reduces the need for manual copywriting and music generation, allowing advertisers to focus on defining the "intent" of their campaign.
The Philosophy of Agent Boundaries
One of the most difficult challenges for the engineering team was defining where an agent ends and standard code begins. Rasam advocates for a pragmatic approach: "Whatever can be deterministically coded should be deterministically coded."
If a rule is static—such as an age bracket or a geographic constraint—it should be handled by code and unit tests. If the logic involves sentiment, creative tone, or complex intent resolution, it is a task for an agent. For example, when an advertiser asks for a specific target audience, an agent is used to resolve the intent, but the actual data validation (e.g., ensuring a target age is within the platform’s supported 18–99 range) is gated by deterministic code. This prevents the "hallucination" of invalid age buckets or non-existent geographic regions.
Official Insights: Lessons in Reliability
Spotify’s approach to reliability relies on a three-tier evaluation strategy:
- Tool Trajectory: Verifying that the agent follows the correct logical steps.
- Deterministic Assets: Validating output against strict schemas (e.g., ensuring the correct JSON structure for an ad campaign).
- LLM-as-a-Judge: Using a specialized, scoped LLM to evaluate the sentiment, brand fit, and semantic coherence of the generated output.
"Tracing is the prerequisite for evaluation," says Rasam. "If you have an evaluation that verifies output without the trace, that’s mere theater." By using OpenTelemetry to record the journey of every agent interaction—including the raw input, tool calls, and final decision-making process—Spotify can replay production traces to test new models without relying on synthetic data.
Implications for the Industry
The implications of Spotify’s architecture are profound for the broader engineering community. By shifting away from "black box" AI, they have demonstrated that Generative AI can be integrated into high-stakes, revenue-generating production environments.
Patterns for Future Development
Spotify has successfully prototyped several key agentic patterns that other teams can adopt:
- The Router Pattern: A classifier determines the user’s intent and routes the query to the appropriate agent (e.g., billing vs. technical).
- The Generator-Critic Loop: A generator creates an output, and a "critic" agent evaluates it, refining the result until it meets specific quality standards.
- Parallel Fan-out: Running agents in parallel to reduce latency, provided they can operate independently.
The "Do Not" List
Reflecting on their mistakes, the team warned against three specific pitfalls:
- Global System Prompts: Avoid putting all instructions into one massive prompt.
- Over-reliance on LLMs: Do not use an LLM for tasks that can be performed by a simple API call or a database lookup; it wastes tokens and increases latency.
- CI-Blocking Evals: Running LLM-based evaluations as part of every merge request is cost-prohibitive. Instead, Spotify uses offline, nightly evaluation runs to ensure quality without slowing down the development cycle.
Conclusion
Spotify’s transition to a multi-agent system marks a significant milestone in the maturity of Generative AI in the enterprise. By treating agents as modular, owned, and observable software components, the company has created a framework that is both flexible enough to handle complex creative tasks and stable enough to support real-world advertising campaigns. As more organizations look to scale their AI efforts, the "single agent, single package" model established by the Spotify Ads team provides a blueprint for moving from experimental prototypes to reliable, production-scale intelligence.








