Optimizing RAG-based Search Results for Production: A Journey from POC to Production

statista · Research & Academia · 2023 · source Agentic: no · promotional bias: med · 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: Research-data RAG search

Statista needed to turn a costly, low-quality Research AI proof of concept into a production RAG product for discovering statistics and insights.

Constraints:

Architecture

Statista added traceability, LLM-as-a-judge quality metrics, more than 100 experiments, multi-query rewriting, and HyDE to optimize Research AI for production.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  research-ai-interface["Research AI Interface"]
  query-rewriting-and-hyde["Query Rewriting and HyDE"]
  rag-pipeline["RAG Pipeline"]
  traceability-and-evaluation["Traceability and Evaluation"]
  research-ai-interface --> query-rewriting-and-hyde
  query-rewriting-and-hyde --> rag-pipeline
  rag-pipeline --> traceability-and-evaluation
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Research AI Interface Receives user research questions. Query Rewriting and HyDE
Query Rewriting and HyDE Improves semantic retrieval from the statistics corpus. RAG Pipeline
RAG Pipeline Retrieves and generates answers from Statista content. Traceability and Evaluation
Traceability and Evaluation Tracks behavior and evaluates quality with LLM-as-a-judge. —

Data flow

User research questions are rewritten into multiple queries, HyDE generates hypothetical retrieval targets, the RAG pipeline retrieves statistics and insights, traces capture behavior, and LLM-as-a-judge metrics guide experiments.

“implemented comprehensive traceability, established quality metrics using LLM-as-a-judge evaluation, and conducted over 100 experiments to optimize the RAG pipeline.”summary, stated
“Key techniques included multi-query rewriting and HyDE (Hypothetical Document Embeddings) to improve semantic retrieval.”summary, stated

Why this architecture

The production effort attacked both retrieval quality and operational cost through traceable experiments rather than accepting the expensive POC.

“Starting with a proof-of-concept that made 42 LLM calls per request and had only 30% quality scores”summary, stated

Models used: RAG · LLM-as-a-judge · HyDE · Multi-query rewriting

Scale

Alternatives considered (roads not taken)

Ship the proof of concept unchanged

Rejected because: It made 42 LLM calls per request and had only 30% quality.

“only 30% quality scores”summary, stated

Patterns

rag-retrieval (retrieval)

Research AI uses RAG over Statista's curated statistics.

“generative AI product called Research AI”summary, stated

query-rewriting (retrieval)

Multi-query rewriting and HyDE improve semantic retrieval.

“multi-query rewriting and HyDE (Hypothetical Document Embeddings)”summary, stated

llm-as-judge (evaluation)

LLM-as-a-judge metrics guided RAG optimization.

“quality metrics using LLM-as-a-judge evaluation”summary, stated

Tradeoffs

Reinvest savings into quality

Chose Use cost savings for quality-boosting techniques over Only minimizing cost.

Rationale: The system needed production quality as well as lower cost.

“65% savings reinvested in quality-boosting techniques”summary, stated

Gotchas (what bit them)

POC RAG quality and cost can be far from production-ready.

Root cause: The initial system made too many LLM calls and scored poorly.

Resolution: Add traceability, metrics, and many targeted retrieval experiments.

“42 LLM calls per request and had only 30% quality scores”summary, stated

Evaluation

Statista used traceability, LLM-as-a-judge quality metrics, experiment counts, cost, latency, and quality improvement.

Metrics: Quality score · Cost reduction · Latency improvement · Experiment count

“140% quality improvement”summary, stated

Outcomes

Statista serves 30,000 paying customers and millions of curated statistics.

“production-ready system now used by a growing customer base with strong adoption metrics.”summary, stated