Multi-Agent RAG System for Enterprise Data Discovery
wix · Tech · 2024 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: Enterprise data discovery
Wix needed users to find relevant data in a data mesh with hundreds of tables, thousands of dimensions and metrics, and domain-specific ownership.
Constraints:
- Data mesh autonomy made discovery hard across domains such as Wix Stores, Customer Care, and Wix Restaurants.
- Users often did not know which domain contained the data they needed.
- Natural-language questions had to map to a semantic layer and executable SQL.
- Ambiguous terms such as recently needed clarification before query generation.
Architecture
Wix built Anna, a multi-agent RAG assistant backed by Vespa. Agents handle root intent detection and clarification, question validation, question decomposition, question generation for embeddings, and Data Playground structured-query generation. Cube translates structured payloads into SQL, Trino executes queries, and Airflow refreshes embeddings hourly.
Diagram confidence: reconstructed (reconstructed from prose).
flowchart LR root-agent["Root Agent"] question-validation-agent["Question Validation Agent"] question-divider-agent["Question Divider Agent"] question-generator-agent["Question Generator Agent"] data-playground-agent["Data Playground Agent"] vespa-vector-database["Vespa Vector Database"] cube-semantic-engine["Cube Semantic Engine"] trino["Trino"] root-agent --> question-validation-agent root-agent --> question-divider-agent question-validation-agent --> root-agent question-divider-agent --> question-generator-agent question-generator-agent --> vespa-vector-database data-playground-agent --> cube-semantic-engine vespa-vector-database --> question-generator-agent cube-semantic-engine --> trino
Components
| Component | Role | Interacts with |
|---|---|---|
Root Agent |
Detects user intent and resolves ambiguity. | Question Validation Agent, Question Divider Agent |
Question Validation Agent |
Checks supported entities and question types. | Root Agent |
Question Divider Agent |
Decomposes complex questions into simpler subquestions. | Question Generator Agent |
Question Generator Agent |
Generates embedding questions for dimensions and metrics. | Vespa Vector Database |
Data Playground Agent |
Builds structured payloads for SQL generation. | Cube Semantic Engine |
Vespa Vector Database |
Stores embeddings for business-question-based retrieval. | Question Generator Agent |
Cube Semantic Engine |
Translates structured payloads into optimized SQL. | Trino |
Trino |
Executes SQL queries against the data platform. | — |
Data flow
A user asks a data question. The Root Agent checks intent and ambiguity, the Question Validation Agent verifies supported entities and question types, the Question Divider Agent breaks complex questions into subquestions, retrieval finds dimensions or metrics from business-question embeddings, and Data Playground/Cube generates SQL.
Why this architecture
Anna mimics a human analyst by clarifying ambiguity, decomposing questions, searching/exploring, and returning multiple possibilities. Wix deliberately uses Cube for SQL generation so agents can focus on intent and business semantics instead of low-level SQL construction.
Models used: unspecified LLM agents
Scale
- Wix serves over 200 million users worldwide.“Wix, a cloud-based web development platform serving over 200 million users worldwide”summary, stated
- The data mesh contained hundreds of tables and thousands of dimensions and metrics.“Users struggled to navigate hundreds of tables with thousands of dimensions and metrics”summary, stated
- Embedding business questions achieved an 83% dimension-matching success rate.“A key innovation was embedding business questions rather than raw metadata, achieving an 83% success rate in dimension matching.”summary, stated
- Airflow updates embeddings hourly.“Airflow for hourly embedding updates”summary, stated
Alternatives considered (roads not taken)
Embed raw metadata only
Rejected because: Embedding business questions achieved better dimension matching.
Have LLM agents generate low-level SQL directly
Rejected because: Cube handles SQL generation so agents can focus on business logic and intent.
Patterns
multi-agent-orchestration (architecture)
Anna divides data discovery across intent, validation, decomposition, embedding-question, and query-generation agents.
rag-retrieval (knowledge)
Vespa vector retrieval finds relevant dimensions and metrics from business-question embeddings.
query-rewriting (retrieval)
The Question Divider decomposes complex natural-language questions into smaller searchable subquestions.
structured-output-contract (reliability)
Agents produce structured payloads that Cube translates into SQL.
Tradeoffs
Separate SQL generation from intent reasoning
Chose Cube for SQL generation over LLM-generated raw SQL.
Rationale: This keeps agents focused on business semantics and improves modularity.
Embed business questions
Chose Question embeddings generated for dimensions and metrics over Raw metadata embeddings.
Rationale: Business-question embeddings performed better for dimension matching.
Gotchas (what bit them)
Data mesh autonomy made discovery hard for users.
Root cause: Data ownership was distributed across domains, each with its own assets and standards.
Resolution: Anna uses multi-agent clarification, retrieval, and semantic-query generation to guide users.
Ambiguous time terms can break query correctness.
Root cause: A user may say recently without defining the time window.
Resolution: The Root Agent asks clarification questions before proceeding.
Evaluation
Wix measured dimension-matching success and user feedback; the summary highlights an 83% success rate.
Metrics: 83% dimension-matching success · hourly embedding updates
Outcomes
- Anna reduced friction in data exploration for Wix's data mesh.
- Business-question embeddings improved dimension matching.
- Cube and the semantic layer let agents avoid low-level SQL construction.
The case cites 200 million users, hundreds of tables, thousands of dimensions and metrics, 83% success rate, and hourly embedding updates.