top of page

Solving Data Discovery at Scale: How Wix Uses RAG and Multi-Agent Systems to Find the Right Data Fast


Data Mesh Architecture


Introduction


Data discovery is a critical challenge in modern organizations, particularly for those adopting a data mesh approach. As companies transition from centralized data management to domain-driven ownership, locating the right data becomes increasingly difficult. Unlike traditional monolithic data warehouses that operate under a single governance model, a data mesh distributes responsibility across multiple domains, each with its own data structures, standards, and priorities. While this model enhances scalability and domain autonomy, it also introduces complexities in data accessibility and discoverability.


Many organizations struggle with fragmented metadata, duplicated data assets, and inconsistent documentation. Data consumers often do not know which domain holds the relevant data, leading to unnecessary dependencies on domain experts.


This lack of visibility across domains creates bottlenecks, delays insights, and erodes trust in data quality, ultimately impacting business outcomes. A major consequence of these challenges is the emergence of data swamps - vast collections of disorganized, inconsistent, and poorly documented data. Without proper metadata management, governance, and searchability, valuable insights get buried under layers of outdated or redundant datasets, leading to wasted time and missed opportunities.


At Wix, we face these same challenges. Our data spans multiple domains, each representing a different product or feature—Wix Stores, Customer Care, Wix Restaurants, and many more. Each domain operates like a small company with its own developers, data teams, product managers, and QA engineers. While this decentralization aligns well with the data mesh approach, it also makes data discovery complex and time-consuming. We are talking about hundreds of tables with thousands of dimensions and metrics to navigate through.



Data Playground (DPG) and Semantic layer

To tackle these issues, we initially developed a wizard-based data exploration tool that allowed non-data professionals to ask structured business questions - Data Playground.


Data Playground leverages Wix's internal semantic layer, which encodes the relationships between data assets—such as tables, entities, and dimensions. This semantic mapping allows the system to accurately translate structured business questions into executable SQL queries. By understanding how different tables are connected and which dimensions are relevant to each entity, the system can assemble the correct joins, filters, and aggregations without requiring users to navigate the complexity of the underlying data models.


This semantic layer plays a vital role in bridging the gap between the user-friendly interface and our Trino-based query engine. When a structured question is created, the system uses the semantic model to construct a valid and performant Trino SQL query that reflects the user’s intent.


To further simplify the system and reduce the complexity associated with SQL generation, we integrated Cube as the semantic engine behind the scenes. Cube translates the structured payloads into optimized SQL queries, allowing our agents to focus on business logic and intent resolution while offloading SQL generation to a robust and scalable framework. This division of responsibilities enhances system modularity, reliability, and maintainability.


Data Mesh Architecture


However, we quickly realized that users still struggled to select the right metrics and navigate the complexity of Wix’s data landscape. A more intelligent, adaptive approach was needed. That’s where AI and multi-agent systems came into play.



Introducing Anna: An AI-Powered Multi-Agent Assistant


To tackle the challenges of data discovery, we developed Anna - a multi-agent AI assistant that leverages Retrieval-Augmented Generation (RAG) to bridge the gap between natural language business questions and structured queries. Anna serves as the entry point for users, allowing them to interact with data in an intuitive way rather than manually navigating complex data models.


Multi-Agent Systems

Instead of requiring users to sift through an overwhelming number of metrics and dimensions in our semantic layer, Anna allows them to ask questions in natural language via chat. The assistant then translates these questions into structured queries that Data Playground can process.


This AI-driven approach significantly reduces friction in data discovery by guiding users toward the most relevant datasets and metrics.


How Anna Works: A Multi-Agent AI System


Anna is not just a single AI prompt; The idea was to create an assistant that “thinks” and "behaves" like an analyst. It can ask clarification questions, divide the problem into smaller parts, search and explore, and in some cases come back with multiple possibilities to answer the original question.


That is why Anna is a multi-agent system, with each agent playing a specialized role in understanding and refining user queries. By breaking down the process into multiple agents, we make sure each is focused on one task, increasing accuracy, and relevance.


Multi-Agent Systems

Root Agent


The Root Agent is responsible for identifying user intent. It determines whether the user is asking about Wix data or a general Wix-related question. Additionally, it resolves ambiguity by requesting more input when needed, such as clarifying vague terms like “new” or “a lot”. For example,  a user may ask “how many users registered recently?”; but what does “recently” mean?  If the question is a business inquiry, and all ambiguity is solved, it is passed to the Question Validation Agent. If not, the Root Agent handles general inquiries directly.


Question Validation Agent


The Question Validation Agent ensures that the question pertains to one of Wix’s supported entities and verifies if it fits the supported question types. If the question is invalid, this agent provides an explanation to the Root Agent, which then informs the user. If valid, the question moves forward to the Question Divider Agent.



Semantic Search

Question Divider Agent


For complex queries containing multiple conditions, the Question Divider Agent simplifies them into smaller, more manageable sub-questions. For example, a question like "How many users are from the US and use Google Chrome?", is broken down into two separate inquiries: "How many users are from the US?" and "How many users use Google Chrome?". This decomposition improves accuracy and efficiency in processing user queries.




Semantic Search


RAG for Metric & Dimension Matching

One of the biggest challenges in data discovery is identifying the right metric or dimension to answer a business question. To tackle this, we implemented semantic search using Vespa as the underlying semantic vector DB.


The embedding process that populates the Vespa DB, runs hourly through an Airflow DAG, ensuring new dimensions and tables are indexed as the semantic layer evolves.


Embedding is the process of representing data, such as words, phrases, or items, as dense vectors in a continuous vector space, where similar items are represented by vectors that are closer together.


Then, when a user asks a business question, his question is represented as a vector (in real time) and similarity search is performed, against Vespa.


We determined that a single search is successful if the correct dimension or metric is included within the top k results returned; the specific rank of the result within those top k results is not important.


The result is a list of top k dimensions and metrics, most likely to answer the original user question.


AI Assistants


Now instead of choosing the right dimension or metric from thousands of possibilities, the number of options is minimized to just a few.


Our initial attempts involved embedding metadata at the table level, including descriptions and tags. However, this approach was ineffective due to the sheer number of tables per entity and the fact that many columns lacked adequate metadata. We then attempted embedding individual dimensions, which showed some improvement but still struggled with variations across different domains.


A breakthrough came with a change of approach.Instead of matching a user's question to raw metadata, we tried comparing business questions to business questions. For each dimension and metric in our data model, we used generative AI to create a set of questions that it can answer.This approach significantly improved search accuracy and ensured more relevant results.After a few more iterations on the way the questions were created, we got to 83% success rate.


This approach helps in cases where the user is uncertain about which domain their question falls under. By leveraging question to question semantic search, the system can identify dimensions across multiple domains and suggest the most relevant datasets, even if the user is unaware of the exact data source they need.


Question Generator Agent


The Question Generator Agent is responsible for creating the questions for the embedding. It adheres to the defined instructions to enhance the similarity search and generates questions for thousands of dimensions and metrics in a matter of minutes.


AI Assistants


Creating the Query in Data Playground


Data Playground Agent


Once a narrow subset of dimensions is retrieved, the Data Playground Agent takes over. This agent determines the best dimensions for answering the user’s question by analyzing the top results from the semantic search. Using this information, it generates a structured API payload based on Data Playground’s API definition. An API call to Data Playground  is performed to create the structured query—the question representation in DPG, that later will be executed using the semantic layer. If there is ambiguity, the agent may return multiple possible interpretations of the original question  and create multiple queries in DPG.


AI Assistants

Part of the agent's response is a link to the Data playground application UI, where the user can view the query results, edit them, and explore breakdowns and segmentations. It all goes back to the Root Agent, which presents it to the user in a clear and actionable manner.


Data Discovery

Data Playground Retry Agent


In some cases, the structured query creation might fail due to validation errors from the Data Playground service. To address this, the Data Playground Retry Agent steps in. It receives the error message and the failed payload, attempts to correct the issue, and retries the structured query creation. This ensures that users receive valid responses even when minor validation errors occur.


Data Discovery


Challenges along the way


Despite its effectiveness, developing a multi-agent AI system for data discovery comes with its own set of challenges:


Incorrect Dimension Selection - One of the most common issues is selecting the wrong metric or dimension, especially when there is no perfect match for the user’s question. In some cases, the AI may retrieve dimensions that are semantically similar but not entirely relevant, leading to misleading results.For example - “how many sites created more than 3 logos?”, this data doesn’t exist. The RAG retrieved 10 different dimensions for “logo creation”. None of them were relevant. Since LLM models are aimed to please, the DPG agent chooses a completely unrelated dimension. If the user did not  pay attention to the query representation in DPG, he might reach the wrong conclusions. 


Lack of Memory - Since the assistant does not retain memory across interactions, users might receive different results for the same question over time. This can be frustrating, as inconsistencies make it harder for users to trust and validate the information they receive. Addressing this lack of memory is in our future plans.


Managing Agent Responses - Ensuring that users do not receive premature or partial answers is another major hurdle. For example, when the assistant cannot confidently find relevant data to satisfy all parts of a question, it should ideally pause or ask for clarification. However, AI models—especially those optimized to be helpful—often default to producing an answer anyway. This can result in responses that are technically correct for part of the question but misleading overall. Despite efforts to train the agents (like the DPG agent and Root Agent) to recognize and properly handle incomplete results, enforcing this behavior consistently remains difficult.



Results & Conclusions


Building an AI-powered data discovery system, required understanding user intent, handling ambiguity, and intelligently mapping business questions to the right data. User feedback has been overwhelmingly positive, with natural language queries reducing the barrier to entry for data exploration. By combining multi-agent AI with retrieval-augmented generation, we have taken a major step toward making data truly accessible to everyone at Wix.


Looking ahead, we plan to expand support for additional question types, further refine embeddings, and improve personalization based on user behavior. 



Yael Rafalovich

This post was written by Yael Rafalovich



More of Wix Engineering's updates and insights: 

Komentari


bottom of page