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:

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
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

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.

“The system uses specialized agents for intent detection, query validation, question decomposition, and structured query generation.”summary, stated
“Cube translates structured payloads into optimized SQL queries, allowing the AI agents to focus on business logic and intent resolution”summary, stated

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.

“Anna is designed as a multi-agent system that mimics how a human analyst would approach data discovery problems.”summary, stated
“This separation of concerns enhances system modularity and maintainability.”summary, implied

Models used: unspecified LLM agents

Scale

Alternatives considered (roads not taken)

Embed raw metadata only

Rejected because: Embedding business questions achieved better dimension matching.

“embedding business questions rather than raw metadata, achieving an 83% success rate in dimension matching.”summary, stated

Have LLM agents generate low-level SQL directly

Rejected because: Cube handles SQL generation so agents can focus on business logic and intent.

“allowing the AI agents to focus on business logic and intent resolution rather than low-level SQL construction.”summary, stated

Patterns

multi-agent-orchestration (architecture)

Anna divides data discovery across intent, validation, decomposition, embedding-question, and query-generation agents.

“The system uses specialized agents for intent detection, query validation, question decomposition, and structured query generation.”summary, stated

rag-retrieval (knowledge)

Vespa vector retrieval finds relevant dimensions and metrics from business-question embeddings.

“leveraging Retrieval-Augmented Generation (RAG) with Vespa as the vector database.”summary, stated

query-rewriting (retrieval)

The Question Divider decomposes complex natural-language questions into smaller searchable subquestions.

“Question Divider Agent: Handles complex queries by decomposing them into simpler sub-questions.”summary, stated

structured-output-contract (reliability)

Agents produce structured payloads that Cube translates into SQL.

“Cube translates structured payloads into optimized SQL queries”summary, stated

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.

“Cube translates structured payloads into optimized SQL queries, allowing the AI agents to focus on business logic and intent resolution”summary, stated

Embed business questions

Chose Question embeddings generated for dimensions and metrics over Raw metadata embeddings.

Rationale: Business-question embeddings performed better for dimension matching.

“A key innovation was embedding business questions rather than raw metadata, achieving an 83% success rate in dimension matching.”summary, stated

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.

“data ownership is distributed across multiple domains (Wix Stores, Customer Care, Wix Restaurants, etc.).”summary, stated

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.

“when a user asks "how many users registered recently?", the agent prompts for clarification on what "recently" means before proceeding.”summary, stated

Evaluation

Wix measured dimension-matching success and user feedback; the summary highlights an 83% success rate.

Metrics: 83% dimension-matching success · hourly embedding updates

“achieving an 83% success rate in dimension matching.”summary, stated

Outcomes

The case cites 200 million users, hundreds of tables, thousands of dimensions and metrics, 83% success rate, and hourly embedding updates.

“significantly reducing friction in data exploration and receiving positive user feedback.”summary, stated