Encoding Domain Expert Knowledge: The Context Layer Behind Spotify's Data Assistant
Key point
Spotify built an AI data assistant based on a context layer that combines domain expert knowledge to deliver accurate insights across a massive dataset.
Details
Spotify developed an AI Data Assistant to solve the data access bottleneck caused by tens of thousands of datasets and petabyte-scale data. Simply feeding all schemas into an LLM had problems: it hit the limits of the context window and failed to capture the actual semantics of the data.
To address this, Spotify manages data domains as Clusters, each composed of three core elements directly maintained by domain experts.
- Datasets: Data warehouse table information including schema, column cardinality, sample values, and partition structure
- Pairs: Expert-verified 'question-SQL' pairs that serve as a Few-shot mechanism to teach the LLM data query patterns and semantics
- Docs: Additional information such as term definitions, caveats, and business context that differs by team
The assistant follows a ReAct loop, repeating reasoning and execution: when a user asks a question in natural language via Slack, an IDE (MCP server), or the web UI, it generates and runs SQL, then returns the results along with the query and its sources. This structure ensures Trustworthiness and transparency in the model's answers.
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.