Manuscript Offprint
arXiv:2610.25096Toward Agentic Retrieval-Augmented Generation for Enterprise Retail Workflows over Heterogeneous Data Sources
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Jeonghwan Choi , Jibin Hwang , Hayoon Park , Hyeonjae Cheon , Hwanjun Song
Korea Advanced Institute of Science and Technology (KAIST), Cluvion, GS Retail
Enterprise retail workflows require agents to chain evidence across heterogeneous sources, from structured product and order records to unstructured inquiries and reviews, yet existing agentic RAG benchmarks rarely capture this challenge. To enable controlled evaluation of such workflows, we introduce RetailBridge, a compositional retail benchmark built from persona-driven simulations. Its questions are constructed by linking entities and intermediate answers across heterogeneous sources, requiring agents to identify the relevant sources, carry evidence between them, and produce a grounded answer. To systematically evaluate LLMs on these retail workflows, we develop RetailRAG, a retail-aware framework equipped with auto-schema briefing, source-routed plan chaining, and diagnostic plan revision. RetailRAG consistently outperforms existing agentic RAG baselines across all evaluation axes, serving as a strong reference system for assessing LLM agents on retail workflows. On RetailBridge, evaluating ten LLM backbones with RetailRAG reveals multi-source chaining as the dominant bottleneck across providers and model scales, suggesting that reliable retail agents require explicit cross-source orchestration rather than scaling alone. Code and data are publicly available at https://github.com/DISL-Lab/RetailBridge.
Date: Oct 16, 2026
Correspondence: Hwanjun Song at songhwanjun@kaist.ac.kr
First Authors:
Jeonghwan Choi at hwani.choi@kaist.ac.kr,
Jibin Hwang at jibinhwang@kaist.ac.kr
Code & Data: https://github.com/DISL-Lab/RetailBridge

DISL
DATA INTELLIGENCE
SYSTEM LAB
KAIST 한국과학기술
1 Introduction
Retail has become a major application domain for large language model (LLM) agents, spanning e-commerce assistance, seller analytics, and customer support Bianchi et al. (2024); Wang et al. (2025c); Choi et al. (2026). In this setting, reliable responses require grounding in internal enterprise records such as product catalogs, order histories, and customer interactions, making retrieval-augmented generation (RAG) Gao et al. (2024); Yan et al. (2025) the core paradigm. However, real retail queries rarely reside in a single repository; they span heterogeneous sources combining structured tables and unstructured text. Answering them requires agents to route across sources, bridge isolated evidence, and synthesize a final answer.
Several agentic RAG methods have been proposed, including reasoning-and-acting agents Yao et al. (2023); Nahid and Rafiei (2026), plan-then-retrieve agents Lee et al. (2024); Yang et al. (2025b), and iterative retrieval agents Fang et al. (2025); Asl et al. (2025). However, they remain limited in two ways. First, they operate on single homogeneous corpora, unlike real retail workflows that require chaining evidence across structured tables and unstructured text. Second, they are evaluated mainly on open-domain sources such as the Web or Wikipedia, leaving their behavior on enterprise retail data largely unverified. Recent enterprise-RAG benchmarks highlight this gap, with top agentic systems achieving only 32% on heterogeneous deep-search tasks Choubey et al. (2025) and text-to-SQL agents only 20–25% on realistic database interactions Huo et al. (2026). Therefore, current LLM agents
Equal contribution. Corresponding author.

Figure 1: Overview of RetailBridge. Starting from persona-driven retail simulations, RetailBridge constructs a heterogeneous retail database, then (Step 1) generates source-grounded atomic QAs and (Step 2) recursively composes them via entity-linked and answer-linked operators into multi-source, multi-hop queries stratified along three evaluation axes.
struggle to navigate complex schemas, coordinate evidence across heterogeneous sources, and execute multi-step enterprise workflows reliably.
The core bottleneck is twofold. On the "data" side, real enterprise retail data and high-difficulty workflow queries are rarely accessible, limiting controllable evaluation of multi-source reasoning. On the "framework" side, existing agentic RAG systems are poorly suited to heterogeneous, schema-rich retail environments, often assuming a single corpus or a single source modality. Consequently, benchmarking current LLMs on enterprise retail workflows requires both a realistic, controllable data testbed and a retail-aware agentic framework that can faithfully orchestrate cross-source reasoning; otherwise, measured performance may conflate LLM capability with data or framework limitations.
We first address the data bottleneck by introducing RetailBridge, a multi-source retail QA benchmark for evaluating agentic RAG systems on enterprise retail workflows. Unlike generic agentic RAG benchmarks such as HERB Choubey et al. (2025) and SPARTA Park et al. (2026), RetailBridge is built around two key ideas, as illustrated in Figure 1. First, we simulate realistic enterprise retail environments by mapping persona-driven seller-buyer interactions into heterogeneous retail data, where each interaction is stored as either structured database records or unstructured text. Second, we construct retail queries with controllable difficulty through a two-step compositional synthesis pipeline. In the first step, we generate and verify source-grounded atomic QAs from individual structured or unstructured sources, providing reliable single-source questions and a controllable pool of composition anchors. In the second step, we recursively compose these atomic QAs using entity-linked and answer-linked operators, which respectively replace an explicit entity or intermediate result with evidence that must be resolved from another source. This process yields 1,680 multi-source, multi-hop queries across three difficulty levels, with difficulty systematically controlled by reasoning depth and source transitions. Consequently, RetailBridge supports diagnostic evaluation beyond aggregate accuracy, revealing performance degradation across difficulty levels, cross-source joining ability, and pipeline failure points.
On the framework side, we develop RetailRAG, the first retail-aware agentic RAG framework for systematically benchmarking how different LLM backbones handle enterprise retail workflows. Rather than assuming a single corpus or source modality, RetailRAG operationalizes the key capabilities required by enterprise retail workflows: (i) auto-schema briefing, which provides the planner with database schemas, entity links, and analytical constraints before planning; (ii) source-routed plan chaining, which explicitly routes each step to structured or unstructured sources and carries intermediate results across SQL-to-text-to-SQL chains; and (iii) diagnostic plan revision, which identifies and locally repairs failed steps without restarting the entire workflow. By reducing framework-induced failures in schema understanding, cross-source orchestration, and plan recovery, RetailRAG enables a more faithful evaluation of LLM capabilities on enterprise retail workflows.
We conduct two complementary evaluations on RetailBridge. First, we compare RetailRAG with representative agentic RAG systems to establish a strong reference system for enterprise retail workflows. RetailRAG consistently outperforms baselines such as MAC-SQL Wang et al. (2025a) and HetaRAG Yan et al. (2025), particularly on queries requiring multi-source bridging. Second, using RetailRAG as a common evaluation framework, we benchmark a diverse set of open-source and proprietary LLM backbones. Across models, accuracy drops substantially as queries require more source transitions and deeper reasoning chains, with failures concentrated in multi-source chaining (from Level-1 to Level-3). These results identify cross-source orchestration, rather than model scale alone, as the central bottleneck in enterprise retail RAG. Our main contributions are:
• RetailBridge, the first multi-source retail QA benchmark, built by mapping persona-driven seller-buyer simulations into a heterogeneous enterprise database without privacy constraints.
-
A compositional QA synthesis pipeline whose entity-linked and answer-linked operators recursively yield multi-source, multi-hop retail queries across three levels of compositional depth.
-
A multi-stage validation of benchmark quality and practical relevance through human review, retail domain-expert assessment, and comparison with a real retail dataset.
• RetailRAG, the first retail-aware agentic RAG framework, integrating auto-schema briefing, source-routed plan chaining, and diagnostic plan revision.
- A comprehensive benchmark of diverse agentic RAG baselines and LLM backbones, exposing multi-source chaining as the fundamental bottleneck of current retail LLM agents.
Agentic RAG Systems. RAG grounds language model outputs in external evidence Lewis et al. (2020); Gao et al. (2024), and agentic extensions enable multi-hop retrieval through reasoning-and-acting agents that interleave retrieval with reasoning traces Yao et al. (2023); Nahid and Rafiei (2026), plan-then-retrieve agents that decompose a query before retrieving Wang et al. (2023); Lee et al. (2024); Yang et al. (2025b), and iterative retrieval agents that refine subsequent searches with intermediate evidence Trivedi et al. (2023); Zhang et al. (2024); Fang et al. (2025); Asl et al. (2025). Yet these systems assume a single homogeneous text corpus over open-domain passages such as Wikipedia, ignoring heterogeneous stores where structured databases and unstructured text coexist, and aggregate evidence post-hoc rather than chaining intermediate results as inline arguments.
Such limitations make them ill-suited for enterprise retail, where queries must traverse heterogeneous sources with intermediate evidence carried across them.
Heterogeneous QA Benchmarks. Evaluating agents on realistic enterprise workflows requires QA benchmarks in which evidence is genuinely scattered across heterogeneous sources, rather than packaged within a single document. Prior work has progressed from single-passage extraction Rajpurkar et al. (2016) and text-only multi-hop reasoning Yang et al. (2018); Trivedi et al. (2022) to benchmarks that pair structured tables with linked passages Chen et al. (2020; 2021) and add numerical reasoning over tables and paragraphs Zhu et al. (2021); Zhao et al. (2022). More recent efforts move toward independently stored sources in enterprise or tree-structured settings Choubey et al. (2025); Park et al. (2026). However, their heterogeneity is co-located and explicitly linked through hyperlinks or shared headers, so multi-source chaining reduces to following an existing link. Enterprise retail instead requires resolving such links implicitly across independently maintained sources.
3 RetailBridge: Multi-Source QA over Heterogeneous Retail Sources
RetailBridge is a multi-source retail QA benchmark whose queries require bridging evidence across independently maintained structured and unstructured sources. We construct it through (i) a heterogeneous retail database from persona-driven simulations (Section 3.1), and (ii) a compositional pipeline that synthesizes atomic QAs and composes them via entity-linked and answer-linked operators into multi-source, multi-hop queries (Section 3.2).
3.1 From Simulation to Retail Database
Real-world enterprise retail data are inaccessible due to privacy constraints, yet faithfully reproducing their heterogeneity is essential for evaluating multi-source retail QA. Inspired by recent persona-driven retail simulators Choi et al. (2026), we simulate multi-stage seller-buyer interactions, with each stage mapped onto a heterogeneous database that mirrors a real enterprise stack. Notably, the simulator has been validated to reproduce real-world economic regularities, grounding our database in realistic retail dynamics.
Persona-Driven Retail Trajectories. Following Choi et al. (2026), we simulate seller-buyer interactions conditioned on structured personas specifying each participant's demographics and behavioral tendencies. Anchored on a shared product catalog, each trajectory progresses through five stages—sales pitch, pre-purchase inquiry, order, post-purchase inquiry, and review—with each stage building on prior outcomes so that a trajectory forms a coherent retail history. These trajectories provide the basis for the multi-source heterogeneous database D, with every record traceable to its originating interaction. Details on the simulation are in Appendix B.1.
Heterogeneous Source Mapping. We construct D from the simulated trajectories together with their anchoring product catalog through two steps: (i) projection, which labels each item with its retail stage s (e.g., sales pitch, order) and its available heterogeneity axes , and (ii) aggregation, which collects items sharing into a source , yielding of eight sources:
• Tabular Sources (h=TAB): five tables—two for product catalogs and order logs, and three for the relational metadata of sales scripts, reviews, and customer-service inquiries.
• Textual Sources (h=TXT): three text collections with only the raw text of sales scripts, reviews, and customer-service inquiries.
Crucially, these sources remain independently structured yet linkable implicitly through shared identifiers of sellers, products, and buyers, which is exactly the cross-source joining that RetailBridge queries are designed to exercise. See Figure 6 in Appendix B.2 for the detailed heterogeneous database schema.
3.2 Compositional QA Synthesis
We synthesize RetailBridge’s queries in two steps: (Step 1) generating atomic QAs answerable from a single source (Section 3.2.1), and (Step 2) recursively composing them via
Table 1: Examples of the two composition operators in RetailBridge. Colors mark each operator's bridged value (, ) and the referring expression hiding it in .
| Operator | Query | Example |
|---|---|---|
| (Level-1) | Which seller broadcast the Libby's Mixed Vegetables (8.5 oz, Pack of 12)? A: Robert A. | |
| (Level-) | What is the average product review rating for Robert A.? A: 3.41 | |
| (Composite) | What is the average product review rating for the seller who broadcast the Libby's Mixed Vegetables? A: 3.41 | |
| Effect | Single-entity bridge (SCRIPT REVIEW); a singular hides one entity | |
| (Level-) | Which of Mark A.'s products received the highest rating in product reviews? A: {Stretchable Candy Necklace, ...} | |
| (Follow-up) | What is the total revenue from orders of these products? A: $20,712.52 | |
| (Composite) | What is the total revenue from orders of the products that received the highest rating in product reviews among Mark A.'s products? A: $20,712.52 | |
| Effect | Set bridge (REVIEW ORDER); a plural hides the whole answer set |
entity-linked and answer-linked operators into multi-source, multi-hop queries across three difficulty levels (Level-1 to Level-3) (Section 3.2.2).
3.2.1 Atomic QA Generation
Atomic QAs serve two roles in RetailBridge: as the Level-1 base (answerable from a single source) and as anchors for multi-source composition. To ensure their reliability, we (i) select a piece of evidence from a single source, (ii) generate each atomic QA grounded in it, and (iii) validate the result with two complementary filters, retaining only QAs that pass both.
Evidence Selection. To cover varied perspectives, we sample triplets from the simulated trajectories and treat each entity in as a question anchor. For each anchor, we identify a source in which the anchor appears and select a specific piece of evidence from the source—a table cell when (e.g., the product's price), or a self-contained snippet when (e.g., a phrase from the buyer's product review)—yielding a gold answer . For numerical questions, where LLM-inferred answers are prone to hallucination Li et al. (2025a), we construct an additional source storing metrics (e.g., aggregations, rankings, rates) derived from the tabular sources, from which we draw ; this source is used only during QA construction and excluded from at test time.
QA Generation. From each piece of evidence , an LLM generates a Level-1 question (atomic) and a heterogeneity-specific search query , executed on to yield an answer :
where is a SQL query when and a retrieval query when . To diversify phrasing and reduce model-specific bias, we split the sampled triplets evenly across three strong LLMs (Qwen3.6-Max, DeepSeek-V4-Pro, Gemini-3.1-Pro) under the same prompt. We store each atomic QA as a tuple , tagging it with the originating stage and heterogeneity axis , which enables RetailBridge to precisely control the source diversity and evidence modality of every query.
Atomic QA Verification Filters. Since unreliability in atomic QAs would propagate through composition, we retain only if it passes two complementary filters:
For reproducibility, all prompts used throughout the RetailBridge pipeline are provided in Tables 22–40 of Appendix F.
• Executable Verification: we automatically filter out QAs whose fails to execute on (or for numerical questions), ensuring every retained QA is answerable from its source.
• LLM Verification: we further filter QAs through two judges (GPT-5.5, Claude Opus 4.7), retaining only QAs where both independently confirm that targets the entity queried by and that is grounded in the retrieved evidence.
The verified atomic QAs form the atomic pool for multi-source composition, spanning all eight sources and both heterogeneity axes so that composition can bridge any source combination.
3.2.2 Recursive QA Composition
Atomic QAs alone stay within a single source, whereas real retail questions chain evidence across sources. To bridge this gap, we build a Level-L composite query from an atomic by recursively lifting to , within or across sources, via one of two operators. The operator is chosen by the type of the value being bridged: (i) entity-linked composition hides a single entity, while (ii) answer-linked composition hides a set- or scalar-valued answer (see Table 1 for operator examples).
Entity-Linked Composition. generates when equals an entity in . Since an entity admits a noun-phrase referent, we prompt an LLM to rewrite , hiding that entity behind a referring expression derived from :
where denotes hiding behind . The chain links , which identifies the entity, with , which produces the final answer.
Answer-Linked Composition. generates when is a set or scalar. Since such answers admit no noun-phrase referent, we first prompt an LLM to write a follow-up question that takes as an explicit answer entity (e.g., asking the total revenue from orders of the answered product set), and then rewrite , hiding behind a referring expression derived from :
The chain links , which produces the bridging value, with , which yields the final answer. Further examples across answer types are provided in Appendix B.3.
Recursive Extension. Each step lifts to via or . The recursion stops at the maximum level , beyond which composed queries become unrealistic for retail. Candidates pass the same two-filter verification scheme as atomic QAs (Section 3.2.1), augmented with composite-specific checks on chain-correctness and referent unambiguity. For diversity in the final benchmark, we embed each query with Qwen3-8B-Embedding and apply farthest-point sampling per level. Throughout this process, every query carries its reasoning level, source diversity, and evidence modality, stratifying RetailBridge along three diagnostic axes.
3.3 Human Verification of RetailBridge
To ensure the reliability of RetailBridge beyond automated verification, we apply a two-stage human verification process with expert annotators, verifying the correctness of each query (Stage 1) and its alignment with real retail workflows (Stage 2). Detailed verification processes are in Appendix C.3.
Stage 1: NLP-Expert Selection. All the queries are independently reviewed by three graduate-level NLP experts along four criteria—query quality, answer correctness, evidence-question alignment, and modality-source consistency. Their judgments show high inter-annotator agreement (Gwet's AC1 = 0.89), and only unanimously approved queries are retained, leaving the final 1,680 queries—a scale comparable to recent RAG benchmarks Lei et al. (2025); Huo et al. (2026)—with three query difficulties from Level-1 to Level-3.
Stage 2: Domain-Expert Verification. To verify that composed queries reflect questions asked in real retail operations rather than arbitrary compositional depth, a domain expert with over ten years of industry experience at GS Retail audited a level-stratified sample of 120 queries drawn from the final set, judging each on whether a seller-side analyst would ask it in practice. The expert marked 90% as questions a seller-side analyst would ask in practice, and this holds even at the deepest composition level, with 97.5% at Level-1, 90.0% at Level-2, and 82.5% at Level-3, confirming that our composed queries remain aligned with real retail workflows.
4 RetailRAG: A Retail-Aware Agentic RAG Framework
Alongside RetailBridge, we propose RetailRAG as a retail-aware reference framework for evaluating LLMs over heterogeneous retail sources. Its design is tailored to retail workflows by explicitly modeling retail schemas and entity links, chaining structured records with unstructured sales, inquiry, and review texts, and recovering from failures within these cross-source chains. As in Figure 2, it addresses domain-specific schemas, SQL-text evidence chains, and costly plan failures through three stages: (i) auto-schema briefing, (ii) source-routed plan chaining, and (iii) diagnostic plan revision.
Auto-Schema Briefing. Effective planning over D requires structural knowledge—its schemas, cross-source join paths, and KPI derivations (e.g., refund rate)—that a query cannot

Figure 2: Overview of RetailRAG, a retail-aware agentic RAG built on (i) auto-schema briefing, (ii) source-routed plan chaining, and (iii) diagnostic plan revision.
provide. RetailRAG therefore precomputes a compact briefing of D and injects it into the planner's prompt. To construct this briefing, a deterministic inspection profiles each column as numeric, categorical, or free-text, and an LLM organizes the result into four sections.
• Schema & Metadata Summary: the role of each source (e.g., order logs, review texts) and its column types with sample values.
• Categorical Value Constraints: valid values per categorical column (e.g., status ∈ {delivered, refunded, exchanged}).
• Entity Alignment Keys: shared columns that connect entities across sources (e.g., product_id linking orders to reviews).
• Derived Analytical Metrics: formulas for KPIs that span multiple tables (e.g., refund rate as refunded orders over total orders), automatically derived by the LLM from the schema.
GS Retail is a major South Korean retailer operating GS25 convenience stores, GS THE FRESH supermarkets, and GS SHOP, with approximately 7,500 employees and annual consolidated revenue of about KRW 12 trillion.
Once injected, the briefing provides the planner with the database structure it needs before planning begins; built solely from the schema, it applies to any database beyond retail.
Source-Routed Plan Chaining. Multi-source queries chain dependent SQL and text lookups, where a single misrouted step invalidates every step after it. RetailRAG therefore determines the chain—each step’s source , search query , and dependency—in a single pass before execution, through three components:
• Adaptive Router: for efficiency, an LLM assesses each query’s complexity and routes simple ones directly to a single tool call, reserving the planning loop for multi-source ones.
• Planning: for complex queries, the planner produces the full chain in a single pass, specifying each step’s source and search query , with later steps referencing earlier results as variables, making cross-modality dependencies (e.g., SQL-to-text-to-SQL) explicit.
• Execution: each planned step then runs on its declared tool, with prior values deterministically substituted into the next step.
This planning keeps every hop aligned with the original question, even as the chain crosses sources and modalities.
Diagnostic Plan Revision. When a step fails mid-chain, restarting from scratch discards both the completed steps and the plan structure built in the previous stage. RetailRAG therefore repairs only the failed step through two stages.
• Diagnose: an LLM detects failures from execution signals (e.g., empty results, zero aggregates) and assigns a typed cause (e.g., schema mismatch, over-restrictive filter), distinguishing errors that need different repairs.
• Revision: guided by the diagnosed cause, an LLM rewrites only the failed step—relaxing a filter, correcting a column, or reformulating the search query—leaving completed steps intact.
Localized repair thus recovers from failures at a fraction of the cost of replanning, while keeping the original evidence flow intact.
5 Evaluation on RetailBridge
In evaluation, we first establish RetailRAG as the evaluation harness for RetailBridge, as weaker harnesses conflate framework-induced failures with model limitations. Thus, we compare RetailRAG against six representative RAG baselines and ablate its retail-specific designs in Section 5.1. RetailRAG outperforms all of them, making it the least confounded harness among those we test. Next in Section 5.2, on this basis, we benchmark ten open-source and proprietary LLMs along RetailBridge.
Benchmark Axes. We evaluate along three complementary axes that diagnose distinct capabilities: (i) reasoning capability, the depth of multi-hop reasoning required (Level-1, Level-2, Level-3); (ii) multi-source chaining, the ability to bridge evidence across sources (Homo.: single source; Hetero.: multiple sources); and (iii) evidence modality, the ability to route across structured and unstructured evidence (SQL-only, Text-only, Composite: SQL+Text).
Evaluation Metric. We evaluate RAG frameworks and LLMs by accuracy (Acc) and LLM-as-judge, a standard metric for RAG evaluation Rau et al. (2024). Acc is a string-containment check (gold answer in prediction), reliable for entity and numeric answers but penalizing valid answers phrased differently; LLM-judge therefore complements it, with Qwen3.6-Plus judging whether each prediction is semantically equivalent to the gold answer. For efficiency, we report the mean number of API calls to the LLM per query. Since agentic frameworks process multi-hop queries through sequential reasoning steps, more API calls increase both latency and cost.

(a) Baselines Comparison.
(b) LLM Benchmarking.
Figure 3: LLM-judge accuracy on RetailBridge per evidence modality (SQL / Text / Composite) across reasoning levels (Level1, Level2, Level3): (a) RetailRAG vs. six baselines; and (b) Ten LLM backbones in RetailRAG, split into open-source and proprietary. The inner axis (—) indicates the overall performance.
Table 2: Performance on RetailBridge. Homo./Hetero.: evidence from one/multiple sources. Acc: accuracy. LLM: LLM-as-judge accuracy. API Call: API calls per query. See Appendix E.2 for the stability of RetailRAG and Appendix E.1 for cross-dataset results.
| Category | Method | Level-1 | Level-2 | Level-3 | Avg. | API Call | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Homo. | Hetero. | Homo. | Hetero. | |||||||||||
| Acc | LLM | Acc | LLM | Acc | LLM | Acc | LLM | Acc | LLM | Acc | LLM | |||
| Naive | Text-to-SQL | 0.421 | 0.421 | 0.225 | 0.229 | 0.121 | 0.129 | 0.129 | 0.175 | 0.062 | 0.094 | 0.163 | 0.182 | 2.00 |
| Dense RAG | 0.050 | 0.200 | 0.004 | 0.108 | 0.010 | 0.121 | 0.017 | 0.067 | 0.010 | 0.096 | 0.016 | 0.115 | 2.00 | |
| Agentic | ReAct | 0.196 | 0.258 | 0.058 | 0.096 | 0.033 | 0.079 | 0.008 | 0.021 | 0.006 | 0.029 | 0.049 | 0.085 | 4.20 |
| MAC-SQL | 0.404 | 0.463 | 0.175 | 0.204 | 0.150 | 0.204 | 0.092 | 0.125 | 0.075 | 0.102 | 0.160 | 0.201 | 3.08 | |
| TableRAG | 0.163 | 0.400 | 0.054 | 0.188 | 0.035 | 0.175 | 0.037 | 0.087 | 0.015 | 0.133 | 0.051 | 0.185 | 6.55 | |
| HetaRAG | 0.379 | 0.504 | 0.188 | 0.336 | 0.108 | 0.263 | 0.133 | 0.263 | 0.062 | 0.212 | 0.149 | 0.293 | 25.21 | |
| Ours | RetailRAG | 0.688 | 0.725 | 0.342 | 0.463 | 0.279 | 0.479 | 0.179 | 0.250 | 0.158 | 0.302 | 0.298 | 0.429 | 7.45 |
5.1 Comparison with Existing RAG Systems
We compare RetailRAG against six RAG baselines in two groups, selected to span retrieval strategies from one-shot SQL or dense retrieval to iterative agentic pipelines:
-
Non-agentic baselines: Text-to-SQL Wang et al. (2020) and Dense RAG Lewis et al. (2020), adapted to our multi-source setting with LLM-based source routing followed by one-shot SQL generation or top-k retrieval.
-
Agentic baselines: ReAct Yao et al. (2023), MAC-SQL Wang et al. (2025a), TableRAG Yu et al. (2025), and HetaRAG Yan et al. (2025), with control flow and prompts preserved; HetaRAG's multi-store architecture is adapted to our setting. Implementation details are in Appendix D.2.
All baselines share the same LLM backbone, embedding model, and top-10 retrieval as RetailRAG. For the baseline comparison, RetailRAG and all baselines use gpt-oss-120b as the backbone model and Qwen3-Embedding-8B for dense retrieval.
We compare RetailRAG against six existing RAG systems on RetailBridge (Section 5.1.1), isolate the contribution of each design through ablations (Section 5.1.2), and further inject the briefing into baselines to measure its standalone effect (Section 5.1.3).
5.1.1 Main Results
Table 2 compares RetailRAG with the six baselines on RetailBridge, which we analyze in turn below.
Reasoning Capability. Existing RAG systems degrade as composition deepens, with the sharpest drops at the Level-1 to Level-2 transition where queries first require multi-hop bridging. RetailRAG remains the strongest at every depth, reaching 0.302 at Level-3 Hetero. against 0.212 for the best baseline (HetaRAG). The reasoning axis therefore separates systems at every depth while leaving substantial headroom at Level-3, establishing compositional depth as a discriminative and unsaturated dimension of RetailBridge.
Multi-Source Chaining. Table 2 further shows that most baselines drop sharply from Homo. to Hetero. queries within each level, indicating that multi-source chaining rather than per-step retrieval is the dominant bottleneck. Even under this drop, RetailRAG preserves the largest Hetero. margin over all baselines at a moderate cost of 7.45 API calls. These results confirm that the Homo./Hetero. axis of RetailBridge isolates cross-source bridging as a failure mode, and that source-routed plan chaining narrows this gap.
Evidence Modality. Figure 3 (a) compares frameworks across SQL-only, Text-only, and Composite (SQL+Text) queries at each reasoning level. Across levels, most frameworks score highest on SQL-only and lowest on Text-only queries, with Composite in between. RetailRAG outperforms all baselines on every modality yet follows the same ordering, showing that the gap across modalities holds regardless of framework design. Accordingly, the modality axis of RetailBridge enables per-modality evaluation of how each framework handles structured and unstructured evidence.
5.1.2 Ablation Study of RetailRAG
Figure 4 ablates RetailRAG's three designs, abbreviated as Schema Briefing, Plan Routing, and Plan Revision for readability (in the same order as Section 4). (i) Schema Briefing and Plan Revision dominate the average drop, peaking at Level-2 where the transition from atomic to multi-hop reasoning is demanding. (ii) Ablating Plan Routing lowers accuracy across levels, most visibly at Level-1, indicating that the routing decision itself contributes to answer quality beyond the planning loop. (iii) Even with any single design removed, RetailRAG outperforms the strongest baseline on average, showing that the three designs contribute jointly rather than any single one being decisive.

Figure 4: Ablation of RetailRAG's three retail-specific designs on RetailBridge (LLM-judge). The --- line marks the best baseline (HetaRAG).
5.1.3 Auto-Schema Briefing Injection Analysis
To validate the effectiveness of our auto-schema briefing itself and to isolate its contribution from RetailRAG's planning designs, we inject the identical briefing into all five baselines that accept schema input. Table 3 shows that the briefing improves every baseline, with the largest gain on Text-to-SQL, which depends most on schema understanding. Nevertheless, even the strongest baseline remains well below RetailRAG while using three times more API calls, confirming that the briefing alone cannot close the gap and that the gains stem from RetailRAG's plan chaining and revision rather than schema access.
Table 3: Effect of RetailRAG's auto-schema briefing on baselines. w/ Briefing: the briefing is injected into each baseline. LLM: LLM-as-judge accuracy. API Call: API calls per query.
| Category | Method | Default | w/ Briefing | ||
|---|---|---|---|---|---|
| LLM | API Call | LLM | API Call | ||
| Naive | Text-to-SQL | 0.182 | 2.00 | 0.296 | 2.00 |
| Agentic | ReAct | 0.085 | 4.20 | 0.102 | 4.29 |
| MAC-SQL | 0.201 | 3.08 | 0.205 | 3.13 | |
| TableRAG | 0.185 | 6.55 | 0.229 | 6.23 | |
| HetaRAG | 0.293 | 25.21 | 0.336 | 23.37 | |
| Ours | RetailRAG | - | 0.429 | 7.45 | |
Table 4: LLM benchmark on RetailBridge by reasoning level and source diversity. Homo./Hetero.: evidence from one or multiple sources. Acc: accuracy. LLM: LLM-as-judge accuracy. API Call: mean LLM calls per query.
| Category | Model | Level-1 | Level-2 | Level-3 | Avg. | API Call | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Homo. | Hetero. | Homo. | Hetero. | |||||||||||
| Acc | LLM | Acc | LLM | Acc | LLM | Acc | LLM | Acc | LLM | Acc | LLM | |||
| Open-source | Qwen3.6-35B-A3B | 0.562 | 0.608 | 0.154 | 0.242 | 0.135 | 0.217 | 0.092 | 0.121 | 0.052 | 0.125 | 0.169 | 0.236 | 12.76 |
| Kimi-K2.5 | 0.621 | 0.658 | 0.179 | 0.254 | 0.129 | 0.204 | 0.113 | 0.158 | 0.090 | 0.154 | 0.193 | 0.255 | 11.81 | |
| Gemma-4-31B-IT | 0.692 | 0.704 | 0.346 | 0.492 | 0.317 | 0.529 | 0.242 | 0.354 | 0.208 | 0.440 | 0.333 | 0.498 | 10.50 | |
| GPT-oss-120B | 0.688 | 0.725 | 0.342 | 0.463 | 0.279 | 0.479 | 0.179 | 0.250 | 0.158 | 0.302 | 0.298 | 0.429 | 7.45 | |
| DeepSeek-V4-Flash | 0.671 | 0.738 | 0.308 | 0.433 | 0.269 | 0.450 | 0.242 | 0.338 | 0.177 | 0.369 | 0.302 | 0.449 | 8.88 | |
| DeepSeek-V4-Pro | 0.713 | 0.762 | 0.329 | 0.475 | 0.306 | 0.490 | 0.212 | 0.321 | 0.183 | 0.362 | 0.319 | 0.466 | 9.68 | |
| Proprietary | Gemini-3.1-Flash | 0.662 | 0.671 | 0.254 | 0.362 | 0.190 | 0.338 | 0.167 | 0.254 | 0.129 | 0.271 | 0.246 | 0.358 | 9.72 |
| Qwen3.6-Flash | 0.662 | 0.667 | 0.354 | 0.438 | 0.277 | 0.406 | 0.212 | 0.275 | 0.167 | 0.271 | 0.302 | 0.390 | 7.32 | |
| Qwen3.6-Plus | 0.700 | 0.713 | 0.379 | 0.533 | 0.312 | 0.506 | 0.250 | 0.375 | 0.244 | 0.471 | 0.349 | 0.511 | 6.92 | |
| GPT-5.4 | 0.700 | 0.742 | 0.383 | 0.546 | 0.335 | 0.542 | 0.254 | 0.367 | 0.202 | 0.408 | 0.345 | 0.508 | 7.28 | |
5.2 Benchmarking LLMs on RetailBridge
Holding RetailRAG fixed as the common backbone, we now shift from frameworks to models and ask how far current LLMs can carry retail workflow queries. Here, we swap ten backbones into RetailRAG—open-source and proprietary, small to large in scale—and analyze their accuracy (Section 5.2.1), source routing performance (Section 5.2.2), and efficiency-accuracy trade-off (Section 5.2.3). LM configurations are provided in Appendix D.1.
5.2.1 Main Results
Table 4 reports the performance of ten backbones under RetailRAG across the three axes of RetailBridge, which we analyze in turn below.
Reasoning Capability. Every backbone loses about half or more of its Level-1 performance by Level-3. Even the strongest models (Qwen3.6-Plus, GPT-5.4) reach average LLM-judge scores of only 0.511 and 0.508, leaving RetailBridge unsolved by current frontier models. Notably, a small open-source model (Gemma-4-31B-IT, 0.498) nearly matches the proprietary leaders, suggesting that reasoning performance depends more on how a model decomposes and plans than on its size or training regime. As a result, the leveled design of RetailBridge surfaces these capability differences that aggregate or single-hop evaluation would miss.
Multi-Source Chaining. Table 4 further shows that at each level, most backbones score lower on Hetero. than on Homo. queries, confirming that bridging evidence across different sources adds difficulty beyond chaining within a single source at the same depth. Interestingly, this gap is not uniform, as large models narrow or even reverse it at Level-3 regardless of model category (Qwen3.6-Plus, GPT-5.4, Gemma-4-31B-IT, DeepSeek-V4-Pro), whereas smaller models remain below 0.30 on Hetero. queries. Cross-source bridging thus emerges as a capability that grows with scale rather than model category. The Homo./Hetero. split of RetailBridge makes this capability separately measurable from reasoning depth.
Evidence Modality. Figure 3 (b) shows the LLM benchmark across SQL-only, Text-only, and Composite queries, separately for open-source and proprietary backbones. Across both groups, backbones degrade less on SQL-only than on Text-only and Composite queries at deeper levels, confirming that the difficulty of a query depends on which evidence modality it requires, not only on its depth. In particular, Text-only queries collapse the steepest, identifying dense text retrieval as the dominant modality bottleneck regardless of model category or scale. The modality split of RetailBridge thus locates each backbone's failures in a specific evidence type, which level-wise scores alone would leave hidden.
5.2.2 Source Routing Analysis
Table 5 reports source routing F1, measuring how accurately each model identifies the right sources by comparing its queried sources against the gold source set per query. Cross-referencing with answer accuracy (Table 4) separates two failure stages, routing to the wrong sources and failing to integrate correctly routed evidence. Routing degrades less sharply than answer accuracy across all backbones, indicating that queries can fail after routing succeeds. Moreover, strong models convert about of their routing F1 into correct answers while weaker models (e.g., Qwen3.6-35B-A3B) convert under . Effective multi-source reasoning thus requires both correct routing and the capacity to integrate routed evidence, a decomposition that the gold source annotations of RetailBridge make possible.
Table 5: Source routing F1 on RetailBridge (1,680 queries) by reasoning level and source diversity. Avg. is weighted by the number of queries per cell (L1/L2-Homo/L3-Homo: 240 each; L2-Hetero/L3-Hetero: 480 each).
| Model | Level-1 | Level-2 | Level-3 | Avg. | ||
|---|---|---|---|---|---|---|
| Homo. | Hetero. | Homo. | Hetero. | |||
| Qwen3.6-35B-A3B | 0.606 | 0.359 | 0.326 | 0.241 | 0.273 | 0.343 |
| Kimi-K2.5 | 0.616 | 0.352 | 0.273 | 0.250 | 0.299 | 0.337 |
| Gemma-4-31B-IT | 0.684 | 0.606 | 0.590 | 0.545 | 0.607 | 0.604 |
| GPT-oss-120B | 0.694 | 0.588 | 0.533 | 0.474 | 0.484 | 0.541 |
| DeepSeek-V4-Flash | 0.703 | 0.563 | 0.551 | 0.509 | 0.529 | 0.562 |
| DeepSeek-V4-Pro | 0.722 | 0.560 | 0.515 | 0.435 | 0.485 | 0.531 |
| Gemini-3.1-Flash | 0.685 | 0.604 | 0.489 | 0.495 | 0.438 | 0.520 |
| Qwen3.6-Flash | 0.683 | 0.684 | 0.557 | 0.640 | 0.519 | 0.594 |
| Qwen3.6-Plus | 0.692 | 0.708 | 0.631 | 0.647 | 0.648 | 0.658 |
| GPT-5.4 | 0.757 | 0.674 | 0.612 | 0.608 | 0.607 | 0.640 |
5.2.3 Efficiency-Accuracy Trade-off
Figure 5 plots each model's trade-off between API calls and answer quality. Across the cost-quality plane, the three reasoning levels form distinct clusters, with Level-1 in the top-left and Level-2/3 in the high-cost region. Within each cluster, additional API calls do not translate into accuracy, as Qwen3.6-35B-A3B and Kimi-K2.5 consume the most calls yet rank lowest, while top backbones reach the ideal corner with substantially fewer. Top open-source models (GPT-oss-120B, DeepSeek-V4-Pro) match the accuracy of the strongest proprietary backbones at a moderately higher cost, indicating that the accuracy gap between providers has largely closed for retail multi-source chaining. Consequently, fewer API calls reflect accurate schema understanding and correct planning, which complete the chain without repeated revisions of failed steps and thereby lead to higher accuracy.

Figure 5: Efficiency-accuracy trade-off of LLM backbones on RetailBridge. Arrow indicates the ideal.
6 Conclusion
We introduced RetailBridge, a compositional multi-source retail benchmark that not only measures aggregate accuracy but localizes failures along reasoning depth, source diversity, and evidence modality, together with RetailRAG, the first agentic RAG framework natively designed for enterprise retail. RetailRAG consistently outperforms baselines, and our LLM benchmark shows that compositional depth and cross-source bridging remain unsolved even for frontier models, with text retrieval as the dominant modality bottleneck. Together, they provide a diagnostic testbed and a reference framework for building LLM agents that operate reliably over real enterprise retail data.
References
Sandhini Agarwal, Lama Ahmad, Jason Ai, Sam Altman, Andy Applebaum, Edwin Arbus, Rahul K Arora, Yu Bai, Bowen Baker, Haiming Bao, et al. gpt-oss-120b & gpt-oss-20b Model Card, 2025.
Anthropic. Claude Opus 4.7 System Card, April 2026.
Mohammad Aghajani Asl, Majid Asgari-Bidhendi, and Behrooz Minaei-Bidgoli. FAIR-RAG: Faithful Adaptive Iterative Refinement for Retrieval-Augmented Generation, 2025.
Gagan Bansal, Wenyue Hua, Zezhou Huang, Adam Fourney, Amanda Swearngin, Will Epperson, Tyler Payne, Jake M. Hofman, Brendan Lucier, Chinmay Singh, Markus Mobius, Akshay Nambi, Archana Yadav, Kevin Gao, David M. Rothschild, Aleksandrs Slivkins, Daniel G. Goldstein, Hussein Mozannar, Nicole Immorlica, Maya Murad, Matthew Vogel, Subbarao Kambhampati, Eric Horvitz, and Saleema Amershi. Magentic Marketplace: An Open-Source Environment for Studying Agentic Markets, 2025.
Federico Bianchi, Patrick John Chia, Mert Yuksekgonul, Jacopo Tagliabue, Dan Jurafsky, and James Zou. How Well Can LLMs Negotiate? NEGOTIATIONARENA Platform and Analysis. In ICML, pages 3935–3951, Vienna, Austria, 2024. PMLR.
Wenhu Chen, Hanwen Zha, Zhiyu Chen, Wenhan Xiong, Hong Wang, and William Yang Wang. HybridQA: A Dataset of Multi-Hop Question Answering over Tabular and Textual Data. In Findings of EMNLP, pages 1026–1036, Online, 2020. Association for Computational Linguistics.
Wenhu Chen, Ming-Wei Chang, Eva Schlinger, William Wang, and William W. Cohen. Open Question Answering over Tables and Text. In ICLR, 2021.
Jeonghwan Choi, Jibin Hwang, Gyeonghun Sun, Minjeong Ban, Taewon Yun, Hyeonjae Cheon, and Hwanjun Song. What Makes a Sale? Simulating End-to-End Seller–Buyer Retail Dynamics with LLM Agents. In COLM, 2026.
Prafulla Kumar Choubey, Xiangyu Peng, Shilpa Bhagavath, Kung-Hsiang Huang, Caiming Xiong, and Chien-Sheng Wu. Benchmarking Deep Search over Heterogeneous Enterprise Data. In EMNLP Industry Track, pages 501–517, Suzhou (China), 2025. Association for Computational Linguistics.
DeepSeek-AI. DeepSeek V4 Technical Documentation, April 2026.
Jinyuan Fang, Zaiqiao Meng, and Craig Macdonald. KiRAG: Knowledge-Driven Iterative Retriever for Enhancing Retrieval-Augmented Generation. In ACL, pages 18969–18985, Vienna, Austria, 2025. Association for Computational Linguistics.
Yunfan Gao, Yun Xiong, Xinyu Gao, Kangxiang Jia, Jinliu Pan, Yuxi Bi, Yi Dai, Jiawei Sun, Meng Wang, and Haofen Wang. Retrieval-Augmented Generation for Large Language Models: A Survey, 2024.
Google. Gemini 3 Developer Guide, 2026.
Google DeepMind. Gemini 3 Flash Model Card, December 2025.
Google DeepMind. Gemini 3.1 Pro Model Card, Feb 2026a.
Google DeepMind. Gemma 4 Model Card, April 2026b.
Yupeng Hou, Jiacheng Li, Xiangjun Fu, Zhankui He, An Yan, Xiusi Chen, and Julian McAuley. Bridging Language and Items for Retrieval and Recommendation: Benchmarking LLMs as Semantic Encoders. In ACL, pages 3251–3265, San Diego, California, United States, 2026. Association for Computational Linguistics.
Nan Huo, Xiaohan Xu, Jinyang Li, Per Jacobsson, Shipei Lin, Bowen Qin, Binyuan Hui, Xiaolong Li, Ge Qu, Shuzheng Si, Linheng Han, Edward Alexander, Xintong Zhu, Rui Qin, Ruihan Yu, Yiyao Jin, Feige Zhou, Weihao Zhong, Yun Chen, Hongyu Liu, Chenhao Ma, Fatma Ozcan, Yannis Papakonstantinou, and Reynold Cheng. BIRD-INTERACT: Re-imagining Text-to-SQL Evaluation via Lens of Dynamic Interactions. In ICLR, 2026.
Myeonghwa Lee, Seonho An, and Min-Soo Kim. PlanRAG: A Plan-then-Retrieval Augmented Generation for Generative Large Language Models as Decision Makers. In NAACL, pages 6537–6555, Mexico City, Mexico, 2024. Association for Computational Linguistics.
Fangyu Lei, Jixuan Chen, Yuxiao Ye, Ruisheng Cao, Dongchan Shin, Hongjin Su, Zhaoqing Suo, Hongcheng Gao, Wenjing Hu, Pengcheng Yin, Victor Zhong, Caiming Xiong, Ruoxi Sun, Qian Liu, Sida Wang, and Tao Yu. Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows. In ICLR, 2025.
Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, and Douwe Kiela. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. In NeurIPS, pages 9459–9474, Vancouver, BC, Canada, 2020. Curran Associates, Inc.
Haoyang Li, Xuejia Chen, Zhanchao Xu, Darian Li, Nicole Hu, Fei Teng, Yiming Li, Luyu Qiu, Chen Jason Zhang, Qing Li, and Lei Chen. Exposing Numeracy Gaps: A Benchmark to Evaluate Fundamental Numerical Abilities in Large Language Models. In Findings of ACL, pages 20004–20026, Vienna, Austria, 2025a. Association for Computational Linguistics.
Jinyang Li, Binyuan Hui, Ge Qu, Jiaxi Yang, Binhua Li, Bowen Li, Bailin Wang, Bowen Qin, Ruiying Geng, Nan Huo, Xuanhe Zhou, Chenhao Ma, Guoliang Li, Kevin Chang, Fei Huang, Reynold Cheng, and Yongbin Li. Can LLM Already Serve as A Database Interface? A Blg Bench for Large-Scale Database Grounded Text-to-SQLs. In NeurIPS, pages 42330–42357, New Orleans, LA, USA, 2023. Curran Associates, Inc.
Yue Li, Ran Tao, Derek Hommel, Yusuf Denizay Dönder, Sungyong Chang, David Mimno, and Unso Eun Seo Jo. Agent Bain vs. Agent McKinsey: A New Text-to-SQL Benchmark for the Business Domain, 2025b.
Aixin Liu, Aoxue Mei, Bangcai Lin, Bing Xue, Bingxuan Wang, Bingzheng Xu, Bochao Wu, Bowei Zhang, Chaofan Lin, Chen Dong, et al. DeepSeek-V3.2: Pushing the Frontier of Open Large Language Models, 2025.
Md Mahadi Hasan Nahid and Davood Rafiei. PRISM: Agentic Retrieval with LLMs for Multi-Hop Question Answering, 2026.
OpenAI. GPT-5.4 Thinking System Card, March 2026a.
OpenAI. GPT-5.5 System Card, April 2026b.
Sungho Park, Jueun Kim, and Wook-Shin Han. SPARTA: Scalable and Principled Benchmark of Tree-Structured Multi-hop QA over Text and Tables. In ICLR, 2026.
Qwen Team. Qwen3.6-35B-A3B: Agentic Coding Power, Now Open to All, April 2026a.
Qwen Team. Qwen3.6-Max-Preview: Smarter, Sharper, Still Evolving, April 2026b.
Qwen Team. Qwen3.6-Plus: Towards Real World Agents, April 2026c.
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: 100,000+ Questions for Machine Comprehension of Text. In EMNLP, pages 2383–2392, Austin, Texas, 2016. Association for Computational Linguistics.
David Rau, Hervé Déjean, Nadezhda Chirkova, Thibault Formal, Shuai Wang, Stéphane Clinchant, and Vassilina Nikoulina. BERGEN: A Benchmarking Library for Retrieval-Augmented Generation. In Findings of EMNLP, pages 7640–7663, Miami, Florida, USA, 2024. Association for Computational Linguistics.
Kimi Team, Tongtong Bai, Yifan Bai, Yiping Bao, SH Cai, Yuan Cao, Ziwei Chai, Y Charles, HS Che, Cheng Chen, et al. Kimi K2.5: Visual Agentic Intelligence, 2026.
Harsh Trivedi, Niranjan Balasubramanian, Tushar Khot, and Ashish Sabharwal. MuSiQue: Multihop Questions via Single-hop Question Composition. TACL, 10:539–554, 2022.
Harsh Trivedi, Niranjan Balasubramanian, Tushar Khot, and Ashish Sabharwal. Interleaving Retrieval with Chain-of-Thought Reasoning for Knowledge-Intensive Multi-Step Questions. In ACL, pages 10014–10037, Toronto, Canada, 2023. Association for Computational Linguistics.
Bailin Wang, Richard Shin, Xiaodong Liu, Oleksandr Polozov, and Matthew Richardson. RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers. In ACL, pages 7567–7578, Online, 2020. Association for Computational Linguistics.
Bing Wang, Changyu Ren, Jian Yang, Xinnian Liang, Jiaqi Bai, Linzheng Chai, Zhao Yan, Qian-Wen Zhang, Di Yin, Xing Sun, and Zhoujun Li. MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQL. In COLING, pages 540–557, Abu Dhabi, United Arab Emirates, 2025a. Association for Computational Linguistics.
Jiangyuan Wang, Kejun Xiao, Qi Sun, Huaipeng Zhao, Tao Luo, Jian Dong Zhang, and Xiaoyi Zeng. ShoppingBench: A Real-World Intent-Grounded Shopping Benchmark for LLM-based Agents. In AAAI, pages 33521–33529, Singapore, 2026. AAAI Press.
Lei Wang, Wanyu Xu, Yihuai Lan, Zhiqiang Hu, Yunshi Lan, Roy Ka-Wei Lee, and Ee-Peng Lim. Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Models. In ACL, pages 2609–2634, Toronto, Canada, 2023. Association for Computational Linguistics.
Weiqi Wang, Limeng Cui, Xin Liu, Sreyashi Nag, Wenju Xu, Chen Luo, Sheikh Muhammad Sarwar, Yang Li, Hansu Gu, Hui Liu, Changlong Yu, Jiaxin Bai, Yifan Gao, Haiyang Zhang, Qi He, Shuiwang Ji, and Yangqiu Song. EcomScriptBench: A Multi-task Benchmark for E-commerce Script Planning via Step-wise Intention-Driven Product Association. In ACL, pages 1–22, Vienna, Austria, 2025b. Association for Computational Linguistics.
Ziyi Wang, Yuxuan Lu, Yimeng Zhang, Jing Huang, and Dakuo Wang. Customer-R1: Personalized Simulation of Human Behaviors via RL-based LLM Agent in Online Shopping, 2025c.
Tian Xia, Zhiwei He, Tong Ren, Yibo Miao, Zhuosheng Zhang, Yang Yang, and Rui Wang. Measuring Bargaining Abilities of LLMs: A Benchmark and A Buyer-Enhancement Method. In Findings of ACL, pages 3579–3602, Bangkok, Thailand, 2024. Association for Computational Linguistics.
Guohang Yan, Yue Zhang, Pinlong Cai, Ding Wang, Song Mao, Hongwei Zhang, Yaoze Zhang, Hairong Zhang, Xinyu Cai, and Botian Shi. HetaRAG: Hybrid Deep Retrieval-Augmented Generation across Heterogeneous Data Stores, 2025.
An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, et al. Qwen3 Technical Report, 2025a.
Hansi Yang, Qi Zhang, Wei Jiang, and Jianguo Li. PASemiQA: Plan-Assisted Agent for Question Answering on Semi-Structured Data with Text and Relational Information, 2025b.
Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William W. Cohen, Ruslan Salakhutdinov, and Christopher D. Manning. HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answering. In EMNLP, pages 2369–2380, Brussels, Belgium, 2018. Association for Computational Linguistics.
Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. ReAct: Synergizing Reasoning and Acting in Language Models, 2023.
Xiaohan Yu, Pu Jian, and Chong Chen. TableRAG: A Retrieval Augmented Generation Framework for Heterogeneous Document Reasoning. In EMNLP, pages 14063–14082, Suzhou, China, 2025. Association for Computational Linguistics.
Jiahao Zhang, Haiyang Zhang, Dongmei Zhang, Yong Liu, and Shen Huang. End-to-End Beam Retrieval for Multi-Hop Question Answering. In NAACL, pages 1718–1731, Mexico City, Mexico, 2024. Association for Computational Linguistics.
Yanzhao Zhang, Mingxin Li, Dingkun Long, Xin Zhang, Huan Lin, Baosong Yang, Pengjun Xie, An Yang, Dayiheng Liu, Junyang Lin, Fei Huang, and Jingren Zhou. Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Models, 2025.
Yimeng Zhang, Tian Wang, Jiri Gesi, Ziyi Wang, Yuxuan Lu, Jiacheng Lin, Sinong Zhan, Vianne Gao, Ruochen Jiao, Junze Liu, Kun Qian, Yuxin Tang, Ran Xue, Houyu Zhang, Qingjun Cui, Yufan Guo, and Dakuo Wang. Shop-R1: Rewarding LLMs to Simulate Human Behavior in Online Shopping via Reinforcement Learning. In ICLR, 2026.
Yilun Zhao, Yunxiang Li, Chenying Li, and Rui Zhang. MultiHiertt: Numerical Reasoning over Multi Hierarchical Tabular and Textual Data. In ACL, pages 6588–6600, Dublin, Ireland, 2022. Association for Computational Linguistics.
Chenyu Zhou, Xiaoming Shi, Hui Qiu, Yankai Jiang, ShaoGuo Liu, Tingting Gao, Haitao Leng, Xiawu Zheng, and Rongrong Ji. Mix-Ecom: Towards Mixed-Type E-Commerce Dialogues with Complex Domain Rules. In ICLR, 2026.
Fengbin Zhu, Wenqiang Lei, Youcheng Huang, Chao Wang, Shuo Zhang, Jiancheng Lv, Fuli Feng, and Tat-Seng Chua. TAT-QA: A Question Answering Benchmark on a Hybrid of Tabular and Textual Content in Finance. In ACL-IJCNLP, pages 3277–3287, Online, 2021. Association for Computational Linguistics.
Appendix Contents
A Ethics and Fairness 18
B Benchmark Construction 18
B.1 Simulation Setup for RetailBridge 18
B.2 Schema of the Heterogeneous Retail Database 19
B.3 Answer-Linked Composition by Answer Type 20
C Benchmark Statistics and Validity 20
C.1 Data Statistics of RetailBridge 20
C.2 QA Examples from RetailBridge 22
C.3 Human Annotation 22
C.4 Comparison with Human-Authored Queries 22
C.5 Audit of Reasoning Paths 23
C.6 Generator-Family Analysis 23
C.7 Robustness to Data Noise 24
D Experimental Setup 24
D.1 LLM Configurations 24
D.2 Implementation Details on Baselines 25
D.3 Reliability of LLM-Judge Evaluation 25
E Additional Analyses 27
E.1 Baseline Evaluation on BIRD 27
E.2 Stability of RetailRAG 27
E.3 Baselines with RetailRAG Components 27
E.4 Oracle Analysis 28
F Prompt Design 28
A Ethics and Fairness
We identify no significant ethical risks in this work, and address the four considerations below.
Data Privacy. RetailBridge contains no personally identifiable information or real customer records. All interactions are produced by persona-driven simulation with persona names unlinked to any real individual, and product metadata is drawn from a publicly available dataset Hou et al. (2026). This design eliminates the privacy risks inherent in real-world enterprise data, such as customer re-identification.
Consent. Human verification was conducted by graduate-level NLP experts and a retail domain expert, who participated voluntarily, provided informed consent, and received clear annotation instructions; the annotators were compensated above the local statutory minimum wage. Since the task collected no data about the annotators themselves and involved only quality judgments over synthetic instances, it does not constitute human subjects research and did not require IRB review.
Bias. RetailBridge is grounded in real-world signals at multiple points. Its product catalog is curated from real Amazon data Hou et al. (2026), its simulator has been validated to reproduce real-world economic regularities Choi et al. (2026), and its queries are audited by a retail domain expert with 90% approval (Section 3.3) and shown to read on par with human-authored retail queries (Appendix C.4). To further reduce model-specific bias in generation, we diversify agent and generator backbones across four LLM families. Under this design, no biases surfaced in our expert verification stages.
Potential Misuse. RetailBridge is released solely for evaluating agentic RAG systems, and as it contains no real customer records, it poses no re-identification risk. Our experiments use publicly available LLMs and APIs in accordance with their licenses. See Appendix C.3 for human annotation details.
B Benchmark Construction
B.1 Simulation Setup for RetailBridge
We produce persona-driven seller-buyer trajectories using RetailSim Choi et al. (2026), extended with additional scenario-level controls and instantiated at our own scale. These trajectories serve as the raw material from which D is constructed.
Agents and Role Assignment. Each simulation run instantiates 16 sellers and 96 buyers from pre-built persona configurations. Each agent is defined by a name, gender, role-specific traits, and an assigned LLM backbone. Seller traits include assertiveness, friendliness, and rationality, while buyer traits include pickiness, price consciousness, and rationality, conditioning the agent's tone and behavior throughout the simulated journey. LLM backbones (DeepSeek-V3.2, Gemini-3-Flash, GPT-oss-120B, Qwen3-235B) are assigned to seller and buyer agents in a balanced manner for each run.
Products. The product catalog is curated from Amazon Reviews 2023 Hou et al. (2026), selecting products with valid metadata and normalizing them into four retail categories (Food, Home, Fashion, Electronics) with 50 products per category. To instantiate a realistic retail environment, each product is further augmented with a flat shipping fee of .
Retail Scenario Controls. To reflect realistic retail settings, the simulation is governed by scenario-level factors. Each product is promoted by one or two sellers, enabling both exclusive sales pitches and competing offers. Sales pitches are scheduled within bounded promotion windows with assigned discount rates, and each buyer is exposed to only a

Figure 6: Schema of the heterogeneous retail database used in RetailBridge.
Table 6: Examples of answer-linked composition with in RetailBridge, covering entity-set and scalar answers. Colors mark the bridged value () and the referring expression hiding it in .
| Operator | Query | Example |
|---|---|---|
| (Entity Set) | (Level-) | Which products sold by Leslie B. have the highest refund rate? A: {Dell 2019 New ..., Herstyle Certain...} (2 products) |
| (Follow-up) | What is the average product review rating for these products? A: 3.37 | |
| (Composite) | What is the average product review rating for the products sold by Leslie B. that have the highest refund rate? A: 3.37 | |
| Effect | Set bridge (ORDER REVIEW); a plural hides the whole answer set | |
| (Scalar) | (Level-) | What is the total amount spent by Lisa J. across all her orders? A: $3,161.72 |
| (Follow-up) | Which buyers have a total order value greater than$3,161.72? A: {Adam N., Brent B., ...} (18 buyers) | |
| (Composite) | Which buyers have a total order value greater than the total amount spent by Lisa J. across all her orders? A: {Adam N., Brent B., ...} (18 buyers) | |
| Effect | Scalar bridge (ORDER ORDER); a singular hides the threshold value |
random subset. These controls introduce variation in seller competition, promotion timing, buyer exposure, and discount-driven purchase incentives.
B.2 Schema of the Heterogeneous Retail Database
We map the simulated trajectories onto a heterogeneous database of eight sources, spanning five tabular sources (Order, Sales Script, Review, Inquiry, Product) and three textual sources (Script Text, Review Text, Inquiry Text), whose underlying schema is shown in Figure 6. The tabular sources store structured records of retail activities and are linked through shared identifiers such as product_id, seller_id, and buyer_id, while each textual source pairs with a tabular source via its primary key (script_id, review_id, inquiry_id), holding free-text content. This structure captures the heterogeneity of real enterprise retail data, where structured transaction logs coexist with unstructured customer interactions.
Table 7: Statistics of RetailBridge: source-level counts and QA distribution by reasoning capability, multi-source chaining, and evidence modality. Homo./Hetero. denote single- or multi-source evidence; Composite, SQL+Text questions.
| Statistic | Number | |
|---|---|---|
| Sources | 5 tabular / 3 textual | |
| Total rows: 49,718 | Total docs: 43,140 | |
| Tabular (rows / cols) | ||
| Product: 200 / 6 | Order: 6,378 / 14 | Script: 287 / 11 |
| Review: 24,104 / 11 | Inquiry: 18,749 / 9 | |
| Textual (docs / avg. chars) | ||
| Scripts: 287 / 2,286 | Reviews: 24,104 / 294 | Inquiries: 18,749 / 5,730 |
| Total Questions | 1,680 | |
| Generators | ||
| Qwen3.6-Max, DeepSeek-V4-Pro, Gemini-3.1-Pro Validators | ||
| GPT-5.5, Claude Opus 4.7 | ||
| answer type | ||
| Entity: 329 (19.58%) | Set: 211 (12.56%) | Number: 465 (27.68%) |
| Temporal: 84 (5.00%) | Text: 591 (35.18%) | |
| reasoning capability | ||
| Level-1: 240 (14.3%) | Level-2: 720 (42.9%) | Level-3: 720 (42.9%) |
| multi-source chaining | ||
| Homo: 720 (42.9%) | Hetero: 960 (57.1%) | |
| evidence modality | ||
| SQL-only: 600 (35.7%) | Text-only: 600 (35.7%) | Composite: 480 (28.6%) |
The full database format and schema files are available at https://github.com/DISL-Lab/RetailBridge.
B.3 Answer-Linked Composition by Answer Type
While Table 1 illustrates answer-linked composition (Section 3.2.2) with a set-valued intermediate answer, also handles scalar answers arising from aggregation or ranking, which likewise admit no noun-phrase referent. Table 6 presents both types side by side. In each case, the literal answer in the follow-up question is hidden behind the referring expression derived from , and only the surface form of differs, a plural noun phrase for entity sets and a singular one for scalar thresholds.
C Benchmark Statistics and Validity
C.1 Data Statistics of RetailBridge
Table 7 reports the detailed statistics of and the QA distribution.
Source-Level Statistics. consists of five tabular sources (Product, Order, Script, Review, Inquiry) and three textual sources (Scripts, Reviews, Inquiries). Tabular sources span a product catalog and large interaction logs, while textual sources range from short reviews to long inquiries, reflecting the heterogeneity of real enterprise retail records.
QA Generation Pipeline. QA generation is split evenly across three strong LLMs (Qwen3.6-Max, DeepSeek-V4-Pro, Gemini-3.1-Pro) to reduce model-specific bias, and each generated QA is independently verified by two LLM judges (GPT-5.5, Claude Opus 4.7) before being passed to human annotation (Appendix C.3).
Table 8: Representative RetailBridge examples across reasoning capability, multi-source chaining, and evidence modality. Source gives the source diversity (Homo./Hetero.) and the underlying sources an agent must route to; SQL tables are marked with * and text stores with †. Long product names in questions are abbreviated; answers are given in full.
| Level | Source | Modality | Example question / answer |
|---|---|---|---|
| Level-1 | Homo. (Order*) | SQL | Q: What is the total revenue for Michael K.?A: $11,296.83 |
| Homo. (Script†) | Text | Q: What input connections did Mark A. mention for the INSIGNIA 2.1-Channel 80W Soundbar ...?A: RCA, optical digital, mini-jack, and Bluetooth. | |
| Level-2 | Homo. (Order*) | SQL | Q: Which sellers have a refund rate greater than Mark A.'s refund rate?A: Natalie H., Joshua H., Joann I., Robert A., Olivia F., Michael K., Diana G., Daniel X., Ashley X., Steven C., Leslie B., Allen G., Alexander G., Michelle W. |
| Hetero. (Order*, Product*) | SQL | Q: What is the original price of the product sold by Robert A. that has the highest conversion rate?A: $21.31 | |
| Homo. (Inquiry†) | Text | Q: What did Ashley X. tell Gabriel Z. about the return shipping costs for a change-of-mind return of the product that was the subject of a pre-purchase inquiry between Beth A. and Steven C.?A: The buyer must cover the return shipping cost; no prepaid label is provided for a change-of-mind return. | |
| Hetero. (Inquiry†, Script†) | Text | Q: What structural features did the seller highlight to assure buyers that the product the buyer asked about (regarding weight limits and dimensions) can support heavy winter coats?A: The rack features a solid wood core and sturdy metal anchors, providing a rock-solid structure designed to securely hold heavy winter coats. | |
| Hetero. (Order*, Inquiry†) | Composite | Q: What is the flat-rate shipping cost for Crystal T.'s highest net revenue product?A: $7.13 per order. | |
| Level-3 | Homo. (Order*) | SQL | Q: What is the total net revenue (excluding refunds) generated by the sellers with conversion rates greater than Daniel X.'s?A:$41,852.72 |
| Hetero. (Inquiry*, Product*, Order*) | SQL | Q: How many orders fall into each status category for the product sold by Michelle W. that has received post-purchase inquiries and has the highest original price?A: delivered: 11 | exchanged: 7 | refunded: 1 | |
| Hetero. (Review*, Product*, Inquiry†) | Composite | Q: What did Olivia F. explain about the effect of substituting butter for coconut oil on the carb count of the product with the highest original price among those Beth A. rated the highest?A: Olivia F. explained that switching from coconut oil to butter would not affect the carbohydrate content, as both are non-carbohydrate fats. |
QA Distribution. The final benchmark of 1,680 queries is stratified along three diagnostic axes: reasoning capability (Level-1/2/3), multi-source chaining (Homo./Hetero.), and evidence modality (SQL-only, Text-only, Composite). Answer types span entity, set, number, temporal, and free text, reflecting the variety of retail information needs.
C.2 QA Examples from RetailBridge
Table 8 presents representative examples from RetailBridge, selected to cover the combinations of the three diagnostic axes, reasoning level, source diversity, and evidence modality. Each row lists the sources an agent must route to, so that the difficulty progression is visible from single-source lookups at Level-1 to cross-modality chains at Level-3. All questions and answers are shown as they appear in the benchmark.
C.3 Human Annotation
This section details the setup, criteria, and protocol of the human verification introduced in Section 3.3.
Stage 1: NLP-Expert Selection. The three annotators review queries using a web-based annotation interface (Figure 7). Each query is presented together with its gold answer and the ground-truth evidence used to derive it, including executed SQL rows for structured steps and retrieved text snippets for unstructured steps. Each annotator judges every query along the four criteria below and gives a single Pass/Fail verdict, where a query fails if it violates any criterion.
• Query quality: whether the query is natural, unambiguous, and free from malformed references.
• Answer correctness: whether the gold answer is fully supported by the presented evidence.
• Evidence-question alignment: whether the query is answerable from the provided evidence sources alone.
• Modality-source consistency: whether the assigned reasoning level, source diversity, and evidence modality match the required evidence path.
Since all reviewed queries had already passed the strict verification filters (Section 3.2.1), most clear-cut failures were removed before annotation, which contributes to the high agreement among annotators. Annotators were compensated at $7.50 per hour, exceeding the U.S. federal minimum wage.
Stage 2: Domain-Expert Verification. The domain expert holds over ten years of industry experience in retail operations at GS Retail, covering seller-side analytics in practice. For this audit, the 120 queries are drawn evenly across the three levels (40 per level). The expert then gives a binary judgment on each query, whether a seller-side analyst would ask it in practice, and records a brief reason for each query judged otherwise. Throughout, each query is reviewed independently of the Stage 1 results.
Annotation Protocol and Ethics. All annotation stages are limited to quality assessment of QA instances and evidence sources, which contain no personally identifiable information or sensitive user data. Annotators judge dataset quality only according to the criteria above, rather than providing personal opinions or evaluating real users, making the task low-risk for all participants.
C.4 Comparison with Human-Authored Queries
To extend the verification of RetailBridge beyond our own annotators to its fidelity to real retail workloads, we compare its queries against the Spider 2.0-lite retail subset Lei et al. (2025), where SQL-expert annotators wrote questions over real retail databases.
Indistinguishability from Human Queries. We randomly sample 100 RetailBridge queries per level (300 in total) and pair each with a human-authored query from the subset. For each pair, three LLM judges (Claude Opus 4.7, GLM-5.2, Grok-4.5) independently identify which query appears human-written or mark the two as indistinguishable, and their labels are aggregated by majority vote. The judges select our query as human-written or find the pair indistinguishable in 52% of cases on average (61%, 44%, and 50% at Level-1, 2,
Table 9: Query-pattern correspondence between RetailBridge and human-authored queries in real retail workloads. Parentheses indicate the source database of each human-authored query in Spider 2.0-lite.
| Level | Shared query pattern | RetailBridge (ours) | Human-authored workload |
|---|---|---|---|
| L1 | Ranking by frequency | Which buyer has sent the most pre-purchase inquiries to Ashley X.? | Identify the top-3 customers with the highest number of delivered orders. (Olist) |
| L1 | Threshold filtering | How many broadcasts did Michael K. conduct with a discount rate greater than 20%? | Which liquor categories each contribute at least 1% of monthly sales volume? (Iowa Liquor) |
| L2 | Best entity within a resolved group | Among the buyers who gave Diana G. the lowest product-quality rating, which buyer has the highest conversion rate? | Find the top-selling product among customers who bought "YouTube Men's Vintage Henley". (GA360) |
| L3 | Chained lookups with aggregation | Most common delivery date for orders of the most expensive product Jacob Z. ordered from the seller who received the highest total spending from him. | Most-purchased other products by customers who bought the Google Red Speckled Tee, per month. (GA4) |
and 3, respectively), indicating that RetailBridge queries read on par with expert-written ones.
Query-Pattern Correspondence. Query patterns in RetailBridge find close counterparts in the same reference. Table 9 presents illustrative pairs sharing the same underlying pattern, from Level-1 ranking and filtering to Level-3 chained lookups. Beyond these pairs, RetailBridge also includes KPI aggregation (e.g., refund and conversion rates), temporal lookups, and free-text review and inquiry questions that fall outside SQL-only workloads.
C.5 Audit of Reasoning Paths
Since some questions may admit paths other than the one used during construction, we audit all 16,800 runs to examine whether correct runs follow their labeled sources and reasoning levels.
Source Labels. Only 5% of correct runs reach the answer through a source outside the gold label, mainly when text information also appears in table columns, as in the shipping-cost question in Table 8. Since such paths are also valid, we add the identified sources to the gold label as alternative sources rather than treating these runs as label violations. Under both the extended labels and the exclusion of such cases, the level ordering and backbone ranking remain unchanged.
Reasoning Level Labels. We count the steps each correct run takes, where one step is one SQL query or retrieval. As shown in Table 10, most correct runs take at least as many steps as their level (87.3% at Level-2 and 83.8% at Level-3). This suggests that the reasoning paths of correct runs largely align with the intended depth of each level.
Table 10: Number of steps taken by correct runs at each reasoning level.
| Level | 1 Step | 2 Steps | 3+ Steps |
|---|---|---|---|
| Level-1 | 89.2% | 8.8% | 2.0% |
| Level-2 | 12.7% | 64.4% | 22.9% |
| Level-3 | 7.9% | 8.3% | 83.8% |
C.6 Generator-Family Analysis
Since question generators and evaluated backbones partly share model families, we examine whether backbones gain an advantage on questions generated by their own family.
Table 11: LLM-judge accuracy of each backbone by question generator (560 questions per generator; rank in parentheses).
| Backbone | Qwen3.6-Max | DeepSeek-V4-Pro | Gemini-3.1-Pro |
|---|---|---|---|
| Qwen3.6-35B-A3B | 0.212 (#10) | 0.245 (#10) | 0.252 (#10) |
| Kimi-K2.5 | 0.237 (#9) | 0.266 (#9) | 0.263 (#9) |
| Gemma-4-31B-IT | 0.468 (#3) | 0.490 (#3) | 0.536 (#2) |
| GPT-oss-120B | 0.418 (#6) | 0.421 (#6) | 0.446 (#6) |
| DeepSeek-V4-Flash | 0.430 (#5) | 0.457 (#4) | 0.461 (#5) |
| DeepSeek-V4-Pro | 0.446 (#4) | 0.443 (#5) | 0.509 (#4) |
| Gemini-3.1-Flash | 0.346 (#8) | 0.366 (#8) | 0.361 (#8) |
| Qwen3.6-Flash | 0.384 (#7) | 0.407 (#7) | 0.380 (#7) |
| Qwen3.6-Plus | 0.502 (#1) | 0.491 (#2) | 0.539 (#1) |
| GPT-5.4 | 0.477 (#2) | 0.511 (#1) | 0.536 (#2) |
| Mean | 0.392 | 0.410 | 0.428 |
Table 12: Self-family advantage of backbones on their own family's questions over other generators' questions.
| Generator | Backbones | Advantage (%p) |
|---|---|---|
| Qwen | Qwen3.6-35B-A3B, Qwen3.6-Flash, Qwen3.6-Plus | +1.0 |
| DeepSeek | DeepSeek-V4-Flash, DeepSeek-V4-Pro | -1.1 |
| Gemini | Gemini-3.1-Flash | -2.8 |
| All families | 6 backbones | -0.4 |
Each question is generated by one of three LLMs (Appendix C.1), so we compare accuracy across question generators and estimate each family's advantage on its own questions.
Accuracy by Generator. As shown in Table 11, backbone rankings remain highly consistent across generator groups (Kendall's ), so which backbones perform well does not depend on the question generator.
Self-Family Advantage. We estimate each family's advantage on its own questions through a regression with question and backbone fixed effects, which removes generator difficulty. As shown in Table 12, a one-sided test with question-clustered standard errors finds no significant advantage for any family (all ).
C.7 Robustness to Data Noise
Real enterprise records contain noise that our simulated data may not reproduce. To quantify this gap, we inject noise into of records for every noise type, so that types can be compared fairly, covering name and category variants, mixed date formats, blanked names, and typos and colloquialisms in text. On a stratified 200-question subset, RetailRAG drops from 0.410 to 0.230, mostly because the agent treats corrupted names and categories as exact keys and misses records. Realistic noise thus makes RetailBridge harder, and we release this noisy variant alongside the clean benchmark.
D Experimental Setup
D.1 LLM Configurations
Table 13 lists the LLMs used across simulation, QA generation, QA verification, and RetailRAG evaluation, together with their roles. Within each stage, all models receive the same prompt format to ensure fair comparison.
Stage-Specific Models. For simulation, seller and buyer agents are instantiated with a diverse set of open-source and proprietary backbones to mirror the variety of real interactions. For QA generation and verification, we use stronger instruction-following models to improve quality, correctness, and consistency. For the LLM benchmark, the listed backbone models are swapped into RetailRAG on RetailBridge under a unified setup.
Deployment. All proprietary models are accessed through their respective APIs, while open-source models are deployed locally on NVIDIA RTX PRO 6000 Blackwell Server Edition GPUs with 96GB VRAM. We use each model's default decoding configuration.
Table 13: LLM configurations across the three pipeline stages: simulation, benchmark construction (QA generation and verification), and RetailRAG evaluation. Models used in multiple stages are listed under each relevant stage.
| Stage | Type | Model | Usage | Model Checkpoint | Source | Reference |
|---|---|---|---|---|---|---|
| Simulation | Open-source | DeepSeek-V3.2GPT-oss-120BQwen3-235B | SimulationSimulationSimulation | deepseek-ai/DeepSeek-V3.2openai/gpt-oss-120bQwen/Qwen3-235B-A22B-Instruct | HuggingFaceHuggingFaceHuggingFace | Liu et al. (2025)Agarwal et al. (2025)Yang et al. (2025a) |
| Proprietary | Gemini-3-Flash | Simulation | gemini-3-flash-preview | Google API | Google DeepMind (2025) | |
| Benchmark Construction | Open-source | Qwen3-Embedding-8B | QA Sampling | qwen/qwen3-embedding-8b | HuggingFace | Zhang et al. (2025) |
| Proprietary | Qwen3.6-MaxDeepSeek-V4-ProGemini-3.1-ProGPT-5.5Claude Opus 4.7 | QA GenerationQA GenerationQA GenerationQA VerificationQA Verification | qwen3.6-max-previewdeepseek-v4-progemini-3.1-pro-previewgpt-5.5claude-opus-4.7 | Qwen APIDeepSeek APIGoogle APIOpenAI APIAnthropic API | Qwen Team (2026b)DeepSeek-AI (2026)Google DeepMind (2026a)OpenAI (2026b)Anthropic (2026) | |
| Retail-RAG | Open-source | GPT-oss-120BQwen3.6-35B-A3BKimi-K2.5Gemma-4-31B-ITDeepSeek-V4-Flash | RetailRAGRetailRAGRetailRAGRetailRAG | openai/gpt-oss-120bqwen/qwen3.6-35b-a3bmoonshotai/kimi-k2.5google/gemma-4-31b-itdeepseek/deepseek-v4-flash | HuggingFaceHuggingFaceHuggingFaceHuggingFaceDeepSeek API | Agarwal et al. (2025)Qwen Team (2026a)Team et al. (2026)Google DeepMind (2026b)DeepSeek-AI (2026) |
| Proprietary | DeepSeek-V4-ProGemini-3.1-FlashQwen3.6-FlashQwen3.6-PlusGPT-5.4 | RetailRAGRetailRAGRetailRAGRetailRAG; LLM JudgeRetailRAG | deepseek-v4-progemini-3.1-flash-previewqwen3.6-flashqwen3.6-plusgpt-5.4 | DeepSeek APIGoogle APIQwen APIQwen APIOpenAI API | DeepSeek-AI (2026)Google (2026)Yang et al. (2025a)Qwen Team (2026c)OpenAI (2026a) |
D.2 Implementation Details on Baselines
This section details the implementation of each baseline in Table 2. All methods share a common LLM backbone, dense embedder, and LLM-as-judge, with method-specific parameters following each paper's published defaults.
Common Setup. All baselines and RetailRAG share the same backbone LLM (GPT-oss-120B), embedder (Qwen3-Embedding-8B), and LLM-as-judge (Qwen3.6-Plus) to ensure fair comparison. SQL execution runs on SQLite endpoints over the five tabular sources, and text retrieval uses a dense index over the three textual sources.
Baseline-Specific Setups. Beyond the common setup, each baseline follows its design as summarized below.
-
Text-to-SQL: a one-shot Text-to-SQL baseline with an LLM-based source-routing step that selects one target SQL endpoint per query, providing a lower bound on SQL-only performance.
-
Dense RAG: a dense retrieval baseline with the same routing step over text sources, retrieving top-k=10 passages with the shared embedder.
-
MAC-SQL Wang et al. (2025a): the three-agent pipeline of Selector, Decomposer, and Refiner, with prompts following the official repository.
-
TableRAG Yu et al. (2025): the iterative explore loop with top-k passages and bounded sub-question iterations routed through a Text-to-SQL tool.
-
HetaRAG Yan et al. (2025): the heterogeneous-store pipeline of query rewrite, dense retrieval, Text-to-SQL, rerank, and answer composition.
For all baselines, we preserve each paper's core design and prompts, applying only minor adaptations needed to run them in our environment (e.g., swapping the backbone for parity, or adapting tool bodies to our SQL/text stores). These modifications keep the methods faithful to their original intent while ensuring fair comparison.
D.3 Reliability of LLM-Judge Evaluation
Since our main evaluation relies on a single LLM judge (Qwen3.6-Plus) that also appears among the evaluated backbones, we validate it from four perspectives, namely agreement with humans, agreement with independent judges, consistency with rule-based scoring, and the separation of correctness from evidential support.
Human Agreement. Three graduate-level NLP annotators independently labeled the correctness of answers from the ten backbones on 250 questions (2,500 items), stratified by reasoning level, source diversity, and final-hop modality. Given their high agreement (Krippendorff's ), we use the majority label as ground truth and compare the paper judge with two independent judges, Muse-Spark-1.3 and MiMo-V2.6-Flash. As shown in Table 14, the paper judge shows very high agreement with humans (Cohen's ), as the gold answers in RetailBridge are well-defined.
Table 14: Agreement between LLM judges and human labels.
| Judge Model | Cohen's | Precision | Recall | F1 |
|---|---|---|---|---|
| Qwen3.6-Plus (Paper) | 0.960 | 0.971 | 0.984 | 0.978 |
| Muse-Spark-1.3 | 0.959 | 0.991 | 0.963 | 0.977 |
| MiMo-V2.6-Flash | 0.939 | 0.944 | 0.990 | 0.966 |
Multi-Judge Agreement and Self-Preference. We re-judge all 16,800 answers (10 backbones × 1,680 questions) with the two independent judges. To test whether the Qwen judge favors Qwen backbones, we define bias as the additional score it assigns to them relative to the reference judge (%p), where a positive value indicates self-preference. Table 15 shows that both independent judges agree almost perfectly with the paper judge and preserve the backbone ranking. Question-level bootstrap intervals show no significantly positive bias, and the bias of Qwen3.6-Plus changes sign across reference judges (+0.7 vs. -1.2), indicating no detectable self-preference. We further run the paper judge three times independently, where 98.4% of verdicts are identical across runs and the backbone ranking is unchanged.
Table 15: Multi-judge agreement and self-preference bias of the paper judge (Qwen3.6-Plus).
| Reference Judge | Agreement (Cohen's ) | Ranking (Kendall's ) | Bias (Qwen family) | Bias (Qwen3.6-Plus) |
|---|---|---|---|---|
| Muse-Spark-1.3 | 0.949 | 0.954 | -0.1 | +0.7 |
| MiMo-V2.6-Flash | 0.932 | 0.928 | -0.8 | -1.2 |
Rule-Based Scoring by Answer Type. For number, temporal, set, and entity answers, we apply deterministic normalization and compare the resulting rule-based scores with those of the LLM judge. This covers 10,890 answers, excluding free-text answers, which have no canonical form for deterministic matching. As shown in Table 16, the two differ by less than 0.01 on every answer type, with an overall accuracy of 0.468 under rule-based scoring and 0.473 under the LLM judge. The largest gap appears on entity answers (0.539 vs. 0.547), and temporal answers yield identical scores (0.647). The LLM judge scores equal to or slightly above rule-based scoring on every type, so it does not inflate accuracy beyond what deterministic matching supports.
Table 16: Rule-based vs. LLM-judge accuracy by answer type.
| Answer Type | n | Rule-based | LLM Judge |
|---|---|---|---|
| Number | 4,650 | 0.412 | 0.417 |
| Temporal | 840 | 0.647 | 0.647 |
| Set | 2,110 | 0.409 | 0.411 |
| Entity | 3,290 | 0.539 | 0.547 |
| Total (excl. free text) | 10,890 | 0.468 | 0.473 |
Correctness versus Evidential Support. To separate correctness from grounding, an independent judge checks whether every claim in each answer is supported by the evidence the system actually retrieved, without access to the gold answer. As shown in Table 17, only 0.9% of all answers are correct without support from the retrieved evidence, so correctness rather than guessing or prior knowledge.
Table 17: Correctness vs. support by retrieved evidence over all 16,800 answers.
| Supported | Not Supported | Total | |
|---|---|---|---|
| Correct | 7,057 (42.0%) | 148 (0.9%) | 7,205 (42.9%) |
| Incorrect | 4,145 (24.7%) | 5,450 (32.4%) | 9,595 (57.1%) |
| Total | 11,202 (66.7%) | 5,598 (33.3%) | 16,800 (100%) |
on RetailBridge reflects grounded answering
Table 18: Cross-dataset evaluation on the BIRD benchmark (n=500) across 11 domains. RetailRAG outperforms all baselines in overall accuracy, demonstrating that its retail-specific designs generalize to other domains.
| Category | Method | F1 | Cards | Hero | Football | Throm. | Code | Student | Tox. | Fin. | Debit | Schools | Avg. |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Naive | Text-to-SQL | 0.606 | 0.577 | 0.865 | 0.804 | 0.520 | 0.625 | 0.729 | 0.450 | 0.406 | 0.600 | 0.367 | 0.615 |
| Dense RAG | 0.136 | 0.096 | 0.019 | 0.098 | 0.060 | 0.082 | 0.062 | 0.150 | 0.000 | 0.100 | 0.000 | 0.078 | |
| Agentic | ReAct | 0.455 | 0.365 | 0.615 | 0.549 | 0.340 | 0.469 | 0.562 | 0.325 | 0.344 | 0.233 | 0.300 | 0.432 |
| MAC-SQL | 0.591 | 0.558 | 0.846 | 0.804 | 0.540 | 0.653 | 0.812 | 0.350 | 0.375 | 0.533 | 0.433 | 0.612 | |
| TableRAG | 0.121 | 0.115 | 0.096 | 0.157 | 0.020 | 0.061 | 0.042 | 0.100 | 0.062 | 0.033 | 0.000 | 0.080 | |
| HetaRAG | 0.515 | 0.577 | 0.865 | 0.784 | 0.480 | 0.653 | 0.812 | 0.425 | 0.562 | 0.533 | 0.533 | 0.622 | |
| Ours | RetailRAG | 0.545 | 0.596 | 0.942 | 0.800 | 0.560 | 0.653 | 0.854 | 0.475 | 0.406 | 0.567 | 0.533 | 0.645 |
E Additional Analyses
E.1 Baseline Evaluation on BIRD
To assess whether RetailRAG's retail-specific designs generalize beyond RetailBridge, we evaluate it on BIRD Li et al. (2023), a multi-domain SQL benchmark. We randomly sample 500 queries spanning 11 domains and evaluate all baselines under the same setup as Appendix D.2. As BIRD consists of single-source SQL queries, this evaluation examines whether RetailRAG, designed for multi-source chaining, remains effective on simpler queries across diverse domains.
Results. Table 18 reports per-domain LLM-judge scores. RetailRAG reaches the highest overall accuracy (0.645), outperforming the strongest baseline HetaRAG (0.622) and the SQL-specialist Text-to-SQL (0.615). Domain-level results further show that RetailRAG achieves the best or tied-best score in 7 of 11 domains. The margins are naturally modest, as most queries reduce to single-step SQL where RetailRAG's planning advantages have little room to operate; that it still leads even in this regime shows that the retail-specific designs incur no penalty on simple queries and generalize to other structured-data domains.
E.2 Stability of RetailRAG
Since RetailRAG relies on LLM-driven auto-schema briefing, source-routed plan chaining, and diagnostic plan revision, we examine whether its gains are stable across runs rather than single-seed artifacts. We run RetailRAG five times on RetailBridge with the gpt-oss-120b backbone under random seeds and default temperature, then bootstrap the mean and 95% percentile CI over resamples (Table 19). Run-to-run variation stays within on both scores, and the single-run results in Table 4 lie within all CIs, confirming that the reported gains reflect RetailRAG's design rather than random variation.
Table 19: Stability of RetailRAG across five runs on RetailBridge (gpt-oss-120b). Bottom rows report the bootstrap mean and 95% percentile CI (). Single-run results in Table 4 lie within all CIs.
| Run | Level-1 | Level-2 | Level-3 | Avg. | ||||
|---|---|---|---|---|---|---|---|---|
| Acc | LLM | Acc | LLM | Acc | LLM | Acc | LLM | |
| Run 1 | 0.688 | 0.725 | 0.300 | 0.474 | 0.165 | 0.285 | 0.298 | 0.429 |
| Run 2 | 0.662 | 0.717 | 0.287 | 0.449 | 0.174 | 0.296 | 0.292 | 0.421 |
| Run 3 | 0.679 | 0.729 | 0.293 | 0.436 | 0.165 | 0.303 | 0.293 | 0.421 |
| Run 4 | 0.683 | 0.725 | 0.293 | 0.450 | 0.165 | 0.290 | 0.294 | 0.421 |
| Run 5 | 0.688 | 0.721 | 0.304 | 0.461 | 0.179 | 0.300 | 0.305 | 0.429 |
| Mean | 0.680 | 0.723 | 0.295 | 0.454 | 0.170 | 0.295 | 0.297 | 0.424 |
| 95% CI lo | 0.671 | 0.719 | 0.291 | 0.444 | 0.165 | 0.289 | 0.293 | 0.421 |
| 95% CI hi | 0.687 | 0.727 | 0.300 | 0.464 | 0.175 | 0.300 | 0.301 | 0.427 |
E.3 Baselines with RetailRAG Components
Section 5.1.3 injects only the schema briefing into baselines. To further separate framework design from schema access and recovery budget, we equip each baseline with our schema briefing and retry policy. All methods share the backbone, embedder, and tools of RetailRAG. Since token usage is inherent to each framework, we report it alongside accuracy.
Table 21: LLM-judge accuracy of RetailRAG under each oracle condition.
| Condition | Level-1 | Level-2 | Level-3 | |||||
|---|---|---|---|---|---|---|---|---|
| SQL | Text | SQL | Text | Comp. | SQL | Text | Comp. | |
| RetailRAG | 0.857 | 0.625 | 0.561 | 0.400 | 0.464 | 0.381 | 0.221 | 0.255 |
| Oracle-source | 0.867 | 0.633 | 0.527 | 0.438 | 0.490 | 0.393 | 0.267 | 0.272 |
| Oracle-plan | 0.876 | 0.750 | 0.690 | 0.329 | 0.611 | 0.594 | 0.250 | 0.444 |
| Oracle-intermediate | - | - | 0.469 | 0.442 | 0.619 | 0.502 | 0.433 | 0.469 |
| Oracle-evidence | 0.971 | 0.990 | 0.975 | 0.992 | 0.992 | 0.983 | 0.971 | 0.987 |
As shown in Table 20, every baseline remains below RetailRAG even with our components, while their budgets vary widely, from 3 to 28 API calls and from 2k to 91k input tokens. This indicates that schema access and retry alone do not account for the gap, and that the gains of RetailRAG stem from source-routed plan chaining and diagnostic plan revision.
Table 20: Baselines equipped with RetailRAG's schema briefing and retry (default → briefing + retry). LLM: LLM-as-judge accuracy. API Call: API calls per query.
| Framework | LLM | Input Token | Output Token | API Call |
|---|---|---|---|---|
| ReAct | ||||
| MAC-SQL | ||||
| TableRAG | ||||
| HetaRAG | ||||
| RetailRAG |
E.4 Oracle Analysis
Final answer scores alone cannot tell whether a failure arises from retrieval, planning, entity binding, or answer generation. We therefore provide gold information to one pipeline stage at a time under four conditions, Oracle-source (gold stores per hop), Oracle-plan (gold step plan), Oracle-intermediate (gold intermediate answers), and Oracle-evidence (gold evidence for every hop).
As shown in Table 21, RetailRAG answers nearly all questions correctly under Oracle-evidence (0.97 to 0.99), showing that the main difficulty lies in retrieving the evidence, with the largest gap for text, while evidence interpretation and answer generation are not a bottleneck. Oracle-source also improves accuracy, and Oracle-plan and Oracle-intermediate yield even larger gains in most cells, revealing further bottlenecks in deciding how to retrieve information (planning) and in carrying each hop's result to the next (entity binding).
Hetero. questions reach fewer required sources in every matched cell, so crossing sources makes routing harder. Their higher accuracy in some cells comes from the retrieval step after routing, as most Hetero. Level-3 text chains pass through sales scripts, the easiest store to retrieve from, while Homo. SQL questions more often require derived metrics, the hardest to compute. This gap thus stems from source composition rather than easier cross-source reasoning.
F Prompt Design
We describe the prompts used in RetailBridge construction and RetailRAG reasoning.
Atomic QA Generation. Tables 22–30 provide the prompts for constructing and verifying the atomic QA pool. Table 22 generates SQL atomics as question–SQL pairs and text atomics as question-search-query pairs conditioned on triplet-scoped text records, using type-specific hints in Tables 26–27. For text atomics, Table 23 additionally generates identify-style questions whose hidden answer is recoverable from text evidence. After generation, SQL atomics are grounded by query execution, with failures repaired using Table 24, while text atomics are grounded from the same scoped records using Table 25. Tables 29–30 then validate SQL and text atomics before they enter the approved pool.
Recursive QA Composition. Tables 31–32 provide the prompts for composing higher-level queries from a lower-level QA pool. Table 31 rewrites a target question by replacing an entity, set, or scalar placeholder with a referring expression derived from an earlier level, supporting both entity-linked and answer-linked composition. In answer-linked composition, the follow-up atomic QA is generated using the hints in Table 28 before the intermediate answer is rewritten as a referring expression. Table 32 then verifies the composed question for grammaticality, faithful substitution, preservation of unreplaced constraints, and absence of answer leakage.
RetailRAG Pipeline. Tables 33–40 provide the prompt templates for RetailRAG's agentic workflow, organized around five components: (i) auto-schema briefing in Table 33, which summarizes heterogeneous retail sources into a planner-facing schema context; (ii) adaptive routing in Tables 34–35, which determines the execution path before evidence gathering; (iii) source-routed plan generation and execution in Tables 36–37, which decomposes hard queries into source-specific evidence-gathering steps; (iv) diagnostic plan revision in Tables 38–39, which identifies failed execution paths and repairs the remaining plan; and (v) final answer generation in Table 40, which converts executed evidence into a grounded user-facing answer.
Table 22: Prompt for Atomic QA Generation.
Atomic Question Generation
System
You are a QA item author for a retail company dataset. You write exactly one atomic question–answer pair grounded in a single primary source (a SQL table or a free-text field of sales_scripts/reviews/inquiries).
Generate ONE atomic QA about the given primary source.
• atomic_type=sql → action=sql_query, single-table SQLite query (no JOINs needed).
- atomic_type=text → action=dense_retrieve, natural-language search_query over the free-text content field of sales_scripts/reviews/inquiries.
Rules:
• Question must be semantically about the primary source.
• Valid ops: filter, aggregate, rank, calculate, search, compare. No single-row ID lookups.
- SQL must return a CONCISE answer (scalar, small ranked list, or small GROUP BY). If natural result >30 rows, reframe the question (top-1, count, avg). No raw dumps.
• Use EXACT schema columns. Escape apostrophes with " (SQLite).
- Scope filter: all tables carry denormalized name columns — use WHERE directly, e.g. WHERE seller_name = 'X' or WHERE buyer_name = 'Y' or WHERE product_name = 'Z'. No JOINs required. The scope entity name is given in the Scope description.
• Every question must be ABOUT the scope entity. Do not expose internal IDs in the question.
- If the question uses “each/every/all <category>” phrasing, DO NOT add LIMIT. Add LIMIT only when question says “top N” etc.
• For atomic_type=text: the search_query MUST include the scope entity's name so retrieval is properly scoped.
-
For atomic_type=text: every entity name in question_entities (seller_name, buyer_name, product_name) must appear verbatim and in full in the question. Never abbreviate a product_name or replace it with a shorter title.
-
For atomic_type=text: search_query must be a natural-language retrieval query, not SQL or a Boolean predicate. Do NOT write strings like review_category='broadcast' AND seller_name='X'. Instead write a concise phrase such as "Mindy M. broadcast review of Steven C.'s Mueller thermometer".
-
For atomic_type=text: use record metadata in the provided content headers. reviews_text may include review_category (broadcast/pre-cs/post-cs/product) and review_rating; inquiries_text may include inquiry_type (pre/post). Make the question specific to the relevant text type when the content supports it, and do not merge different review/inquiry types unless the question explicitly asks across those types.
-
NEVER return raw IDs (buyer_id, seller_id, product_id, script_id) as the answer. Use the human-readable name columns: buyer_name, seller_name, product_name.
-
For “highest/lowest/most/least” queries, use subquery to catch ties: WHERE col = (SELECT MAX(col) FROM ...) instead of ORDER BY + LIMIT 1.
• Use SELECT DISTINCT when listing entities to avoid duplicates.
- For rank queries (most recent, highest, lowest, etc.), use a subquery to handle ties correctly — do NOT use SELECT DISTINCT with ORDER BY + LIMIT 1 (ambiguous sort after dedup). e.g. most-recent product → SELECT DISTINCT product_name FROM Script WHERE seller_name='X' AND broadcast_datetime = (SELECT MAX(broadcast_datetime) FROM Script WHERE seller_name='X'). This correctly returns all tied top results.
Output JSON only:
{ "question": "...", "operation_type": "filter|aggregate|rank|search", "action": "sql_query|dense_retrieve", "sql_query": "... " or "search_query": "... " }
User
Scope: {scope_description}
Primary source: {source_name}
Atomic type: {atomic_type}
DB description:
{primary_source_schema_description}
Scope profile (distribution stats — use for realistic thresholds/values):
{scope_profile}
{hint}
Produce ONE operation-level question + executable query.
Table 23: Prompt for Entity-Answer Text Atomic Question Generation
Entity-Answer Text Atomic Question Generation
System
You are a QA item author specializing in identify-style retrieval questions. You describe distinctive content from one text record so that retrieving that record reveals the target entity name — without ever naming the target entity in the question.
Generate a TEXT IDENTIFY-style atomic QA over a single text record. The ANSWER must be exactly the target entity name shown in the user prompt. The QUESTION must describe distinctive content from the evidence record so a retrieval model can find the right record and recover the entity name from it.
Rules:
-
DO NOT mention the target entity name anywhere in the question or search_query (any case, any partial form). The model must infer it from retrieval. For person names like "Steven C." or "Mindy M.", this includes the first name alone ("Steven", "Mindy") and any possessive form ("Steven's", "Mindy's"). Use role words like "the seller" / "the buyer" instead.
-
The user hint lists REQUIRED ANCHORS (seller_name / buyer_name / product_name) — these are the non-target triplet strings. Each listed value is the exact database string: copy it character-for-character into the question. Never abbreviate product_name or replace it with a shorter title; use the full line exactly as given. The search_query is free-form retrieval text and may be phrased naturally, but should still reference the anchors clearly.
-
Use distinctive details from the evidence: ratings, prices, specific short quotes (≤8 words), review_category, inquiry_type, named features, dates. Avoid generic phrasing like "gave a positive review".
• For source=reviews_text: state the review_category (broadcast / pre-cs / post-cs / product) when available.
• For source=inquiries_text: state the inquiry_type (pre / post).
• For source=sales_scripts: anchor on the product and a specific feature or claim from the script.
- Keep wording concise where possible; required anchor strings may be long (full product titles). Not a verbatim quote of the whole evidence.
• DO NOT use IDs (script_id, review_id, inquiry_id, etc.).
• operation_type is always "search". action is always "dense_retrieve".
Output JSON only:
{ "question": "...", "operation_type": "search", "action": "dense_retrieve", "search_query": "..." }
User
Scope: {scope_description}
Primary source: {source_name}
Target answer (the entity to be identified): {target_entity}
Target role: {target_role}
DB description:
{primary_source_schema_description}
Evidence record (the question must point to THIS record):
{evidence_section}
{hint}
Produce ONE identify-style question whose answer is exactly: {target_entity}
Table 24: Prompt for SQL Query Regeneration after Execution Failure.
| SQL Query Regeneration after Execution Failure |
|---|
| SystemYou are a SQLite repair specialist for the retail company dataset. You diagnose a failed query and rewrite it to run correctly against the exact provided schema.A SQL query failed or returned an error. Given the original question and the EXACT source table schema, write a corrected SQL query.Rules:Use ONLY columns listed in the provided schema — do NOT invent columns.SQLite syntax: escape apostrophes by doubling (“)— NEVER use \’.Do NOT SELECT raw ID columns; prefer human-readable name columns (buyer_name, seller_name, product_name).Scope filter: denormalized name columns are present in the table — use WHERE directly (e.g. WHERE seller_name = ‘X’), no JOIN needed for filtering.For “highest/lowest/most/least” queries, use subquery to catch ties: WHERE col = (SELECT MAX(col) FROM ...) instead of ORDER BY + LIMIT 1.Use SELECT DISTINCT when listing entities to avoid duplicates.For rank queries, use subquery instead of ORDER BY + LIMIT 1; do NOT combine SELECT DISTINCT with ORDER BY + LIMIT.SQL must return a CONCISE result (scalar, small ranked list, or GROUP BY).Output JSON only: {“sql_query”: “...”} |
| UserQuestion: {question}Source table schema:{source_schema}{entity_hint}Previous failed SQL:{failed_sql}Failure reason:{error}Write a corrected SQL query that answers the question. |
Table 25: Prompt for Text Atomic Answer Generation, which generates the grounded answer for a text atomic from its scoped evidence records.
| Text Atomic Answer Generation |
|---|
| SystemYou are a retrieval answerer. The records below are ALREADY FILTERED to the relevant scope (specific seller/buyer/product). All records belong to that entity. Given these records and a query, return a concise factual answer grounded in the records. Output only the answer text.Important — answer exactly what was asked:If the query is about what the BUYER asked/inquired/reviewed, extract the buyer’s own words or intent. Do NOT substitute the seller’s answer or a product description.If the query is about what the SELLER said/scripted/promised, extract the seller’s own words. Do NOT summarize the buyer’s reaction or reviews.If the query asks about the PRODUCT (features, specs, etc.), you may cite either party but stay factual.Keep the answer focused on the question; do not pad with unrelated context.Answer only with information explicitly supported by the records.Do not infer unstated details.Priorer short sentences directly grounded in the records.Do not add contextual details not needed to answer the question. |
| UserQuery: {search_query}Records ({in_records}): {records_json} |
Table 26: Generation hints inserted into the {hint} field of the Atomic QA Generation prompt when building Level-1 SQL atomic questions.
| Applied case | Hint |
|---|---|
| Level-1 atomic question entity exact-match block | # tier == "seller": [!] CRITICAL - use this EXACT string in SQL, character-for-character: WHERE seller_name = '{anchor_id}' Do NOT add, remove, or change any character - no trailing quotes, no possessive. # tier == "buyer": [!] CRITICAL - use this EXACT string in SQL, character-for-character: WHERE buyer_name = '{anchor_id}' Do NOT add, remove, or change any character - no trailing quotes, no possessive. # tier == "product": [!] CRITICAL - exact DB values (copy this FULL title literally into SQL): product_name: '{title}' CORRECT form: WHERE product_name = '{title}' DO NOT truncate the title, DO NOT add a trailing apostrophe. |
| Level-1 SQL atomic question | # answer-shape hint constants (ans_hint): _HINT_NAME = "The answer should be an entity NAME (buyer name, seller name, or product name)." _HINT_NUMERIC = "The answer should be a numeric value (count, average, total, ratio, etc)." _HINT_DATE = "The answer should be a DATE or DATETIME (e.g. broadcast date, order date, delivery date)." # (sellers source) ans_hint: "The answer should be a PRODUCT NAME. Ask which product of this seller has the highest or lowest {col}." # _make_focus_hint(focus) -> (note leading space): "Focus the question on `{focus}`." # appended when src == "reviews": "Always filter by one specific review_category value: 'broadcast', 'product', 'pre-cs', or 'post-cs'." # appended when src == "inquiries": "Always filter by one specific inquiry_type value: 'pre' or 'post'." |
| Level-1 SQL atomic question with triplet constraint | TRIPLET-COMBINATION MODE - still generate a SINGLE-TABLE atomic question. Use ONLY the `{src}` primary source table; do NOT use JOINs or any other table. The question must be specifically constrained to this triplet entity combination: {col}={val}', {col}={val}'. The SQL MUST include these exact filters: {col} = '{val}' AND {col} = '{val}'. |
Table 27: Generation hints inserted into the {hint} field of the Atomic QA Generation prompt when building Level-1 text atomic questions.
| Applied case | Hint |
|---|---|
| Level-1 text atomic question sales scripts | # src == "sales_scripts": TRIPLET TEXT CONTEXT - this text source is scoped by seller + product only: - seller: {seller} - product: {product} - buyer is NOT part of sales_scripts scope; do not mention the buyer in the question or search_query. The question must explicitly name the seller ({seller}) and the product ({product}). Ask about what the seller said, emphasized, described, or promised in the sales script. # + diversity_note, appended only when diversity_idx > 0: This is question variation #{idx} - generate a question from a DIFFERENT angle than you would generate by default. Be specific to the actual content of the script. |
| Level-1 text atomic question reviews text | # src == "reviews_text": TRIPLET TEXT CONTEXT - this text source is scoped by seller + buyer + product: - seller: {seller} - buyer: {buyer} - product: {product} The question must explicitly name the buyer ({buyer}), seller ({seller}), and product ({product}). # category_line: if category_filter > first line; else > second line: Focus ONLY on the '&#category_filter' review_category record. Use review_category metadata to make the question specific. # + diversity_note (diversity_idx > 0), with one review angle: This is question variation #{idx} - generate a question from a DIFFERENT angle than the default one. [angle 1] Ask about the buyer's overall opinion, satisfaction, or impression. [angle 2] Ask only about the explicit reason, praised point, criticized point, or concrete detail stated in the review. Do not ask for an overall summary. Avoid near-duplicate wording across variations. |
| Level-1 text atomic question inquiries text | # src == "inquiries_text": TRIPLET TEXT CONTEXT - this text source is scoped by seller + buyer + product: - seller: {seller} - buyer: {buyer} - product: {product} The question must explicitly name the buyer ({buyer}), seller ({seller}), and product ({product}). # type_line: if category_filter > first line; else > second line: Focus ONLY on the '&#category_filter' inquiry_type record. Use inquiry_type metadata (pre or post) to make the question specific. # + diversity_note (diversity_idx > 0), with one inquiry angle: This is question variation #{idx} - generate a question from a DIFFERENT angle than the default one. [angle 1] Ask about the buyer's main question, request, or concern. [angle 2] Ask about concrete details discussed, such as price, shipping, timing, or policy. [angle 3] Ask about the seller's response, clarification, or resolution to the buyer's concern. Avoid near-duplicate wording across variations. |
Table 28: Generation hints inserted into the {hint} field of the Atomic QA Generation prompt when generating follow-up atomic questions. The hint is selected according to the answer type of the corresponding Level-1 atomic question: Set, or Scalar.
| Applied case | Hint |
|---|---|
| Set-answer follow-up atomic question AGG variant | [!] CRITICAL - {col} filter MUST use this exact IN clause (do NOT hardcode names): WHERE {col} IN ({in_clause}) {review_hint} These {n} {entity_label}s form a SET. Generate an AGGREGATION question: - Returns a SINGLE scalar (COUNT / SUM / AVG / MIN / MAX) - About ALL {n} {entity_label}s as a group - not about any individual - Use ''placeholder' to refer to the group in the question text SQL examples (adapt to the actual columns in the data above): SELECT COUNT(*) FROM ... WHERE {col} IN ({in_clause}) SELECT AVG(review_rating) FROM ... WHERE {col} IN ({in_clause}) [+ AND review_category = '...' when source = reviews] |
| Set-answer follow-up atomic question FILTER variant | [!] CRITICAL - {col} filter MUST use this exact IN clause (do NOT hardcode names): WHERE {col} IN ({in_clause}) {review_hint} These {n} {entity_label}s form a SET. Generate a FILTERING/NARROWING question: - Returns one or more {entity_label} names from this set (NOT a scalar) - Use a single condition: argmax/argmin OR a numeric threshold - Use ''placeholder' to refer to the group in the question text - Do NOT use LIMIT - use a WHERE condition instead: argmax -> AND metric = (SELECT MAX(metric) FROM ... WHERE {col} IN (...)) threshold -> AND metric > value SQL examples: SELECT DISTINCT {col} FROM ... WHERE {col} IN ({in_clause}) AND total_price = (SELECT MAX(total_price) FROM ... WHERE {col} IN ({in_clause})) SELECT DISTINCT {col} FROM ... WHERE {col} IN ({in_clause}) [+ AND review_category='...' AND review_rating >= 4 when source = reviews; else AND refund_rate > 20] |
| Scalar-answer follow-up atomic question | [!] SCALAR THRESHOLD HINT - use this numeric threshold from a previous step: Threshold value (MUST appear verbatim in the question): {scalar_val} Threshold measures: '{measure_label}' {review_hint} Generate a question that finds which entities have {measure_label} {op} {scalar_val}. - Include the exact numeric value {scalar_val} in the question text - Entity columns to group/filter by: {entity_cols} # if metric table (buyer_metrics/seller_metrics/products/sellers): SQL pattern (metric table - direct WHERE comparison): SELECT DISTINCT {entity_example} FROM {table} WHERE metric_col {op} {scalar_val} # else (raw table): SQL pattern (raw table - GROUP BY + HAVING): SELECT DISTINCT {entity_example} FROM {table} WHERE review_category = '...' [only when source = reviews] GROUP BY {entity_example} HAVING {agg_expr} {op} {scalar_val} |
Table 29: Prompt for SQL Atomic QA Validation.
SQL Atomic QA Validation
System
You are a gatekeeper for an atomic QA pair.
IMPORTANT CONTEXT: the query was already executed successfully; the shown answer is its actual output.
Domain Context (READ BEFORE JUDGING).
This is a RETAIL COMPANY database. Key relationships:
• SELLERS broadcast live shopping shows (scripts) and sell products to BUYERS.
• Sellers and buyers are completely separate people — never overlapping.
Validator Constitution (applies to ALL cases).
-
NO SPECULATION: never reject based on what "could/might" happen (ties, multiple rows, etc.). Judge ONLY the provided Question + Query + Executed Answer.
-
NO STYLE REVIEW: never reject or complain about SQL/search-query style (DISTINCT, GROUP BY, JOIN vs no JOIN, etc.) if it does not clearly change the meaning of the question.
-
REJECT ONLY OBVIOUS SEMANTIC MISMATCH: approve unless there is a clear contradiction between what the question asks and what the query/answer is about.
For SQL atomics (action=sql_query): TWO criteria.
Criterion 1 — Semantic Alignment (Q ↔ SQL ↔ Answer): Reject only for clear mismatches such as:
• Scope/entity mismatch (question is about seller/buyer/product X but SQL filters different entity or none)
• Concept mismatch (question asks "who/which" but SQL returns a numeric aggregate; asks "how many" but SQL returns a name list)
- Direct contradiction (question says "most recent/latest" but SQL clearly selects MIN; says "highest" but SQL clearly selects MIN)
• Schema-impossible claim (using schema to detect: e.g., Buyer_Metric has no seller_name/product_name, or Seller_Metric has no buyer_name/product_name)
Criterion 2 — Realistic & Safe Question: Reject only if the question:
• Exposes an opaque internal ID (buyer_id, seller_id, script_id, product_id, etc.)
• Is nonsensical or self-contradictory
• Answer leakage: the answer string appears verbatim as a substring of the question.
Output JSON only — list ONLY failed criteria; if approved, failed_criteria is []:
{"approved": true|false, "failed_criteria": [], "issues": ["short concrete description of each failure"]}
Use exact labels "criterion_1" or "criterion_2" in failed_criteria.
User
Atomic QA:
{atomic_qa_json}
Source table schema:
{source_schema}
Return verdict.
Table 30: Prompt for Text Atomic QA Validation.
Atomic QA Validation (Text)
System
You are a gatekeeper for a text atomic QA pair. IMPORTANT CONTEXT: the search query was already executed successfully; the shown answer is its actual output.
Domain Context (READ BEFORE JUDGING).
This is a RETAIL COMPANY database. Key relationships:
• SELLERS broadcast live shopping shows (scripts) and sell products to BUYERS.
• Sellers and buyers are completely separate people — never overlapping.
Validator Constitution (applies to ALL cases).
-
NO SPECULATION: judge ONLY the provided Question + Search Query + Evidence + Executed Answer.
-
NO STYLE REVIEW: never reject because the search-query or answer wording is not how you would phrase it.
-
REJECT ONLY CLEAR FAILURES: approve unless there is a clear contradiction, unsupported answer content, or obvious scope drift.
For text atomics (action=dense_retrieve): THREE criteria.
-
Criterion 1 — Evidence answerability: Using ONLY the provided evidence_content, determine whether the question can be answered. Reject if the evidence does not contain enough information to answer the question.
-
Criterion 2 — Evidence grounding / faithfulness: Reject if the answer contains material information that is not explicitly supported by the evidence_content, or if it contradicts the evidence.
-
Criterion 3 — Scope sanity: If the question names an entity (seller X, buyer Y, product Z), the search_query should include it. Reject ONLY if the entity is missing AND the answer is clearly about a different entity.
-
Criterion 4 — Answer leakage: Reject if the answer string appears verbatim as a substring of the question.
Output JSON only — list ONLY failed criteria; if approved, failed_criteria is []:
{"approved": true|false, "failed_criteria": [], "issues": ["short concrete description of each failure"]}
Use exact labels "criterion_1", "criterion_2", "criterion_3", or "criterion_4" in failed_criteria.
User
Atomic QA:
{atomic_qa_json}
Source table schema:
{source_schema}
Return verdict.
Table 31: Prompt for Composite Question Composition via Referring-Expression Substitution, shared by the entity-linked and answer-linked (Set, S) pipelines. The {entity} field of the user prompt is filled with an entity name, a set placeholder, or a scalar value depending on the variant.
Composite Question Composition via Referring-Expression Substitution
System
You are a multi-hop QA composer. You take a target question and rewrite it by replacing exactly one named entity with a natural referring expression derived from an identifier question whose answer is that entity. Your goal is one fluent, unambiguous interrogative sentence that preserves meaning.
Preserve the target meaning and answer. Use the identifier only to identify the replaced entity.
Rules:
• Replace only the specified entity; preserve all other names, products, dates, times, numbers, and metrics exactly.
• Keep the replaced entity's role unchanged: seller/broadcaster, buyer/reviewer, product, date/time, or value.
• Do not let identifier-side products, reviews, broadcasts, dates, or times become confused with the target object/event.
• If direct substitution creates ambiguity, rewrite the local phrase instead of inserting the referring expression in place.
• If the entity is immediately followed by a “that …” or “where …” clause in the target question, do NOT simply replace the entity name inline. Instead restructure the whole phrase so the “that”/“where” clause clearly attaches to the correct head noun, not to the inserted referring expression. Example: “the product sold by X that generated the highest sales” → “the product that generated the highest sales, sold by [referring expression]”.
• If the entity appears in a possessive position (e.g. “X’s orders”), do NOT produce a sub-clause ending in a participle followed by “’s”. Instead rewrite using a prepositional form: e.g. “orders placed by [referring expression]” or “orders from [referring expression]”.
• Put target dates/times next to the target event, not after a long referring expression.
- When the target question already contains the main action involving another entity, keep that target-side action intact and make the referring expression adjectival or event-based rather than repeating the same action frame. For example, avoid patterns like “the buyer who asked Steven C. about ... ask Steven C. about ...”; instead use shorter phrases such as “the buyer who made a pre-purchase inquiry about ...” or “the buyer who asked about ...”.
• If the result is not one clear natural question, return {"cominable": false}.
Output JSON only: {"cominable": true, "question": "..."} or {"cominable": false}
User
Target question: {target_question}
Target answer: {target_answer}
Identifier question: {identifier_question}
Identifier answer: {identifier_answer}
Entity to replace in target: {"entity"}
Rewrite the target question in english.
[For answer-linked level 2, the following cleft instruction is appended:]
Rewrite as one natural English question. The entity name must not appear — replace it fully with the referring expression. Avoid deeply nested noun phrases; restructure the sentence if needed.
Table 32: Prompt for Composite QA Validation.
| Composite QA Validation |
|---|
| System |
| You are a strict auditor for multi-hop composite QA built by entity substitution. You judge only substitution quality — meaning preservation, grammaticality, and unambiguity — and you reject patterns that other LLMs tend to overlook. The composite question was built by replacing one entity in the target question with a referring expression derived from an earlier chain step (the “replacement step”).IMPORTANT: The composite question may intentionally reference multiple different products, events, dates, or entities. Some are only used to identify an intermediate entity, while another is the actual subject of the final answer. Do NOT reject merely because the identifier-side product/entity differs from the target-side product/entity.Judge ONLY the substitution quality:1. Naturalness: the composite question must be a grammatically correct interrogative sentence, with no malformed possessives, no awkward repetition, no unclear pronouns, and no cataphora (pronoun preceding its named antecedent in the same sentence).2. Substitution accuracy: the inserted referring expression must identify the obfuscated entity using the replacement step's question and answer. It is OK if the expression mentions identifier-side products/events/dates, but reject if they are grammatically confused with the final target object/event or if date/time/product clauses attach to the wrong part of the question.3. Preservation: all other names, products, dates, times, numbers, and metrics from the target question must be preserved exactly, except the replaced entity itself.Approve if the question is long primarily because target product names are preserved exactly, as long as it remains grammatical, faithful, and unambiguous. Do not reject solely because a required preserved product name is long.Reject if the rewrite changes the target meaning, adds unsupported constraints, drops target constraints, reveals the target answer through the referring expression, or makes the substitution ambiguous.Output JSON only: {"approved": true|false, "issues": ["criterion N: reason"]} |
| User |
| Composite QA:{composite_qa_json}Target question before rewrite (the question that was rewritten to produce the composite):{target_question_before_rewrite}Replacement step (the identifier question whose answer replaces the obfuscated entity):{replacement_step_json}Obfuscation context:{obfuscation_context}Return verdict. |
Table 33: Prompt for Auto-Schema Briefing.
Auto-Schema Briefing
System
You produce a planner brief from an inspection JSON of one or more data stores. The brief is read by a downstream SQL planner at every query. Output plain text, with no JSON and no fences. Use exact store, table, column, and value names from the inspection; never invent.
Required sections, in this order:
[Stores]
For each store, one line: "[SQL] <id> - short description" or "[TEXT] <id> - short description".
Under each SQL store, list every column with one of:
• "<col> ∈ {v1, v2, ...}" (enum, exact distinct_values);
• "<col> (numeric)";
• "<col> (e.g. <s1>, <s2>, <s3>)" (freeform, sample_values);
• "<col> (id-shaped)" (high-cardinality identifier).
Under each TEXT store, one sentence covering topic + distinctive vocabulary.
[Enums]
One line per categorical column:
[Entity-grouping columns]
PRIMARY: columns ending in _name, _label, or _title that appear in two or more tables.
SECONDARY: columns ending in _id that appear in two or more tables (join keys, paired with the corresponding _name column when one exists).
Format:
• PRIMARY:
- <col> (in: <table1>, <table2>, ...)
• SECONDARY:
- <id_col> (in: <tables>) paired with <name_col>
[Derived KPIs]
SQL formulas auto-derived from the schema. Use the 4 templates below; substitute placeholders with real names from the inspection. Each KPI is scoped to ONE most-natural entity column – do not replicate the same KPI across every entity column.
CRITICAL: In every template, <entity_col> MUST come from the PRIMARY list in [Entity-grouping columns] AND MUST be a column that actually exists in the
- ENUM-RATE — one KPI per enum value:
<value>_rate(<entity_col>) =
SUM(CASE WHEN <enum_col>='<value>' THEN 1 ELSE 0 END) * 100.0 / COUNT(*)
FROM
- NUMERIC AGGREGATE — avg, total, max, and min per numeric column:
avg_<numeric_col>(<entity_col>) = AVG(<numeric_col>) FROM
total_<numeric_col>(<entity_col>) = SUM(<numeric_col>) FROM
max_<numeric_col>(<entity_col>) = MAX(<numeric_col>) FROM
min_<numeric_col>(<entity_col>) = MIN(<numeric_col>) FROM
- NUMERIC × ENUM CROSS — emit only when semantically meaningful:
avg_<numeric_col>_<enum_value>(<entity_col>) = AVG(<numeric_col>) FROM
WHERE <entity_col>='<X>' AND <enum_col>='<enum_value>'
- CROSS-TABLE CONVERSION — when two tables share a foreign-key column:
conversion_rate(<entity_col>) =
COUNT(DISTINCT child.<shared_id>) * 100.0 / COUNT(DISTINCT parent.<shared_id>)
FROM <parent_table> parent LEFT JOIN <child_table> child
ON parent.<shared_id> = child.<shared_id>
WHERE parent.<entity_col>='<X>'
[Conventions]
• Date columns: filter with LIKE 'YYYY-MM-DD%' or DATE(col)='YYYY-MM-DD'.
• Long freeform string columns: use LIKE '%keyword%' on one to three distinctive words.
• For rank-N by KPI queries: compute the KPI per entity in a CTE, then ORDER BY ... LIMIT N. Do not pre-filter by "above average".
• Use enum values verbatim from [Enums]; do not paraphrase or pluralize.
User
Stores inspection (raw JSON): {inspection_json}
Domain knowledge (optional, append verbatim under header): {kb_text}
Produce the brief now. List EVERY table that appears in the inspection — do not skip any.
BridgeQA Annotation
idle
Dashboard
Switch User
Annotation Instructions
Read once, then collapse. Click Pass if the item meets all criteria. Fail if any criterion fails.
Hide
Each item shows a Query, an Answer, and the GT Evidence (the rows / text snippets used to produce the answer). You judge the item as a single Pass / Fail verdict. Pass requires all of the criteria below to hold. Fail if any one fails.
1. Query
• Grammatical, natural English; no broken phrasing or unclear pronouns.
• Does not expose internal IDs (e.g., $15, B61, F00-B003Y12A28).
• Not self-contradictory; the question makes sense as a real user query.
• The answer text does not appear verbatim inside the question (no answer leakage).
• For multi-level (composite) questions: the rephrased entity reference is unambiguous and clearly points to the intended entity.
2. Answer
• Matches the question type: "who/which" → a name, "how many" → a number, etc.
• Directly answers the final target question (not an intermediate level).
• Not vague or evasive (avoid "various", "many", "unclear").
• For SQL-backed answers: derived from the executed query result, not invented.
3. GT Evidence
• SQL steps: the SQL is semantically aligned with the question (e.g., "highest" uses MAX, not MIN; "who" returns a name, not a count). The shown used rows support the answer.
• Text steps: the highlighted snippet contains the information that produces the answer.
• Multi-level chains: each step's evidence is appropriate for that step, and the chain composes correctly toward the final answer.
• Scope sanity: when the question names an entity (seller / buyer / product), the SQL or text query mentions it.
4. Query type → Source
• The item's query_type must match how the answer is actually produced:
• sql-only — answer comes from SQL over structured tables (orders, reviews, products, metrics, ...).
• text-only → answer comes from retrieved text (reviews_text, inquiries_text, sales_scripts) via search — not from a SQL query.
• both — genuinely combines a SQL step and a text step.
• Fail if the type is mislabeled — e.g., a text-only item whose answer is actually computed from the SQL DB, or a both item that only uses one modality.
Quick rule of thumb: this is a benchmark dataset, so quality must be high. If you have any doubt about an item — even a slight one — mark Fail. Only mark Pass when the Query, Answer, and GT Evidence are all clearly correct.
Item #454
query_type: sql-only
level 3
source_diversity: Hetero(sources=2)
chain_label: atomic_answer_answer
operation_type: rank
QUERY
Which seller has the highest conversion rate among sellers whose average post-purchase customer service rating is greater than Leslie B.'s average pre-purchase customer service rating?
ANSWER
Natalie H.
GT Evidence (rows / text snippets used)
What is the average pre-purchase customer service rating for seller Leslie B.?
sql-only
eval source: reviews (SQL on seller_metrics)
filter
sql
SQL QUERY
SELECT avg_rating_pre FROM Seller_Metric WHERE seller_name = 'Leslie B.'
USED ROWS (1)
{ "avg_rating_pre": 4.49 }
SQL OK (1 rows)
STEP ANSWER
4.49
Which sellers have an average post-purchase customer service rating greater than 4.49?
sql-only
eval source: reviews (SQL on seller_metrics)
filter
sql
SQL QUERY
SELECT DISTINCT seller_name FROM Seller_Metric WHERE avg_rating_post > 4.49
USED ROWS (4)
{ "seller_name": "Natalie H." }
{ "seller_name": "Joshua H." }
{ "seller_name": "Joann I." }
{ "seller_name": "Daniel X." }
SQL OK (4 rows)
STEP ANSWER
Natalie H., Joshua H., Joann I., Daniel X.
Composite rewrite trace (target -- final)
entity = substituted entity | value = substituted answer/value
TARGET
Among these sellers, which seller has the highest conversion rate?
KID
Which sellers have an average post-purchase customer service rating greater than Leslie B.'s average pre-purchase customer service rating?
FINAL
Which seller has the highest conversion rate among sellers whose average post-purchase customer service rating is greater than Leslie B.'s average pre-purchase customer service rating?
Among these sellers, which seller has the highest conversion rate?
eval source:
eval source: reviews (SQL on seller metrics)
rank
sql
Pass
Fail
navigate
next unannotated
toggle instructions
Figure 7: Example of annotation template for verifying query quality over 4 criteria (Pass/-Fail).
Table 34: Prompt for Adaptive Complexity Routing.
Adaptive Complexity Router
System
You classify a retail QA query's reasoning complexity. Output ONE label. simple — 1 hop. The answer is obtainable from a single source via ONE SQL/retrieval step. No bridge entity, no chaining. Plannable as a single atomic step. hard — 2+ hop chain. The query requires at least one bridge entity ("the seller of the product that buyer X ordered"), or multiple aggregations across an entity chain. Needs 2 or more atomic steps. Output JSON only: { "label": "simple" | "hard", "why": "one short reason" }
User
Query:{query} Classify.
Table 35: Prompt for SQL Source Picker
SQL Source Picker
System
You decide which retail SQL databases must be queried to answer a sub-question. Available databases (logical names, each backed by a separate sqlite file):
• products — table Product(product_id, product_name, product_category, original_price, store, features)
• scripts — table Script(script_id, seller_id, seller_name, product_id, product_name, broadcast_datetime, discount_rate, original_price, discount_price, discount_end_date, shipping_fee)
• orders — table "Order"(order_id, script_id, buyer_id, buyer_name, product_id, product_name, quantity, total_price, status, order_date, delivery_date, post_inquiry_type, seller_id, seller_name)
• inquiries — table Inquiry(inquiry_id, inquiry_type, buyer_id, buyer_name, seller_id, seller_name, product_id, product_name, script_id)
• reviews — table Review(review_id, review_category, review_rating, buyer_id, buyer_name, seller_id, seller_name, product_id, product_name, script_id, inquiry_id)
Rules:
• Pick the MINIMUM set that can answer the sub-question. Do NOT pick all five "to be safe".
• If two tables must be JOIN'd (e.g. products + orders), include both.
• Output JSON: {"sources": ["orders", "reviews"], "why": "one short reason"}
• sources MUST be a non-empty subset of the five names above.
User
Sub-question:{sub_query} Output JSON.
Table 36: Prompt for Planning.
Planning
System
Decompose the user query into an ordered list of ATOMIC evidence-gathering steps that solve it ONE PIECE AT A TIME. RULE 0 — ENTITY RESOLUTION FIRST
Before writing the plan, mentally list every named entity in the query (persons, long product/work names, specific datetimes, places).
Your plan's FIRST steps must be DEDICATED entity-resolution lookups for those entities — one entity per step, no other filter or aggregation. Only AFTER all entities are resolved do you write the steps that use those resolved IDs/values as filters.
A resolution step has a SINGLE simple WHERE clause (for SQL) or a short direct query (for dense_retrieve). NEVER combine an entity lookup with ranking or aggregation in one step.
RULE 1 — Atomic decomposition
Each step answers ONE simple sub-question with at most ONE filter, ONE join, OR ONE aggregation. An n-hop query needs exactly n atomic steps — err on MORE granular, an extra simple step is far better than a compound failing one. The LAST step's output IS the final answer. Do NOT add a separate "answer" / "summarize" step.
RULE 2 — Step actions
Exactly TWO action types are allowed:
-
sql_query — single-table or 1-JOIN SQL with at most 1–2 WHERE conditions and at most ONE aggregation/ranking. Each sql_template is a SINGLE valid SELECT (no DDL/DML, no comments, and no trailing semicolon).
-
dense_retrieve — semantic search over text passages. Each search_template is a short natural-language query ( 20 words).
Pick the action that best matches the data store carrying the answer. When the answer lives in SQL columns, prefer sql_query. When the answer is narrative / sentiment / unstructured, prefer dense_retrieve.
RULE 3 — Placeholder substitution (deterministic chain)
Use {{prev_N}} placeholders to reference prior step N's output. At execution time, {{prev_N}} is substituted (in Python, NOT by an LLM) with the literal value(s) step N produced — already SQL-escaped.
Forms:
- {{prev_N}} — comma-separated SQL literals from step N's primary column.
• {{prev_N.col}} — extract a specific column from step N.
• single-value filter: WHERE col = {{prev_N}}
• multi-value filter: WHERE col IN {{prev_N}}
- dense_retrieve: {{prev_N}} expands to comma-separated values. (no SQL quoting). Also valid inside the 'metadata_filter' dict values (see RULE 3b).
NEVER copy literal IDs/values from earlier steps into the SQL — always go through {{prev_N}}.
RULE 3b — metadata_filter on dense_retrieve (hard entity binding)
A dense_retrieve step MAY include a metadata_filter dict that hard-restricts the candidate pool BEFORE embedding similarity. Use this when the prior step resolved an entity that the answer must match exactly:
"metadata_filter": {{ "buyer_name": "{{prev_1.buyer_name}}}}
Allowed keys are the metadata fields of the chosen TEXT store (e.g. buyer_name, seller_name, product_name, inquiry_type, review_category, review_rating). Multiple keys are ANDed. Use metadata_filter for HARD constraints already resolved upstream (the buyer who did X in step 1 → restrict step 2 to that buyer).
DO NOT put descriptive constraints there ("the buyer who mentioned 'soup energy'") — those belong in search_template. If the filter value is wrong/missing the call returns 0 hits, so only filter on values you are confident were resolved.
RULE 4 — Final-step answer slot
The FINAL step's output column type must match the user query's wh-word:
• "who / which seller / buyer" → name column (NOT id)
• "how many" → COUNT(*)
• "what is the total / average" → SUM/AVG aggregate
• "what date / when" → date column
- PLURAL final answer (query uses "which products / categories / buyers / texts", "list", "all", "each", "every", "for each"): the FINAL step must NOT use LIMIT 1 — return EVERY matching row.
If the query asks to identify an entity by NAME, the FINAL step's SELECT must surface the human-readable name column, never the internal id.
RULE 5 — KPI vocabulary (use [Derived KPIs] formulas verbatim)
The DATA STORES brief below contains a [Derived KPIs] section auto-derived from the schema. When the user query asks for ANY metric (rate, average, total, count-by-X, conversion, ranking by score), find the matching KPI in [Derived KPIs] and copy its formula VERBATIM into the SQL — substituting only the entity literal (the '<x> placeholder).
NEVER invent your own KPI definition (e.g. status='success' for delivered_rate, or "above average price" instead of computing the KPI then ranking). NEVER shorten or simplify a KPI formula. NEVER use a column or enum value not in the [Enums] section.
For "rank-N by <KPI>" queries, compute the KPI per entity in a CTE then ORDER BY the KPI with LIMIT N.
DATA STORES (auto-generated; trust these names verbatim)
{db_block}
Routing contract (per step): every step must declare which stores it queries. STORE IDENTIFIERS ARE LITERAL — copy the exact "[SQL]" / "[TEXT]" identifiers from the DATA STORES block verbatim. Do NOT paraphrase (e.g. "reviews_text" — never "Review Corpus", "reviews", or "Reviews"). A wrong identifier triggers SQL ROUTING ERROR / unknown source.
Use "sources" (a list, e.g. ["orders", "reviews"]) when an SQL step needs to JOIN across multiple SQL DBs; use "source" (a single string) for single-store steps. Pick the MINIMUM set of stores that answers the step. Cross-DB JOIN is only allowed across stores listed in "sources" for that step. If a step's SQL must reference a table from another store, that store MUST be declared in "sources" — otherwise the call fails with SQL ROUTING ERROR.
Output JSON only:
{{ "steps": [ { { "step": 1,
"sub_query": "short natural-language description (for trace only)",
"action": "sql_query" | "dense_retrieve",
"source": "<one store name", "sources": ["<store_a>", "<store_b>"] | null,
"sql_template": "SELECT ... (with {{prev_N}} placeholders)" | null,
"search_template": "free-text query with {{prev_N}}" | null,
"metadata_filter": null | {{<meta_key>": "<value or {{prev_N.col}}>"},
"depends_on": null | [<step ids>]
}] ],
"rationale": "one short paragraph"}
User
User query: {query}
Step 1 of your thinking: list every named entity in the query (persons, dates, long product/work names) before deciding the plan order. Resolution steps for those entities come FIRST.
Output the plan JSON only (no entity-list section).
Table 37: Prompt for SQL Query Generation in the SQL Tool.
SQL Query Generation in the SQL Tool
System
SQL writer.
Tables, enums, and auto-derived KPI formulas are in the DATA STORES brief below. Use the EXACT names listed there — case-sensitive, no plural / singular flips.
Generic rules:
• ONE SELECT (or WITH...SELECT). No DDL/DML.
• If a table name is a SQL reserved word, quote it with double-quotes (NOT backticks).
- Use only listed columns. Always spell out the full column name from the schema after a table alias — single-letter or two-letter abbreviations after a dot are never valid.
• Cross-table → JOIN on shared id columns (whatever IDs appear in both).
• Use enum values exactly as listed (case + spacing). Do not paraphrase.
• Return ONLY SQL inside sql ....
Filter precision:
• DATETIME: never match exact seconds/minutes. Use one of:
DATE(col) = 'YYYY-MM-DD'
col LIKE 'YYYY-MM-DD%'
col LIKE 'YYYY-MM-DD HH:%'
- LONG STRING FILTERS (long strings with delimiters or punctuation): use col LIKE '%distinctive-keyword%' on 1–3 most unique words instead of exact equality.
• SHORT NAMES / IDs: use exact match.
• If the question references a SPECIFIC entity, your WHERE clause MUST filter by that entity.
KPI derivation:
- Use the auto-derived KPI formulas in [Derived KPIs] VERBATIM, substituting only the entity literal. Do not invent your own metric definitions.
• For “rank-N by KPI” queries, compute the KPI per entity in a CTE then ORDER BY the KPI with LIMIT N.
DATA STORES (auto-derived; trust these names verbatim)
{db_block}
User
Sub-question: {sub_query}
ROUTING: This call is restricted to target_sources={target_sources}.
Use ONLY tables from these sources: {schema_block_for(target_sources)}
Cross-DB JOIN is allowed only across the selected sources.
Upstream context: {previous_steps}
Write the SQL now. Output JSON.
Table 38: Prompt for Step Diagnosis.
Step Diagnosis
System
A plan step did not produce a usable result. Identify the single most likely root cause. Causes (SQL-side):
• schema_error — wrong table or column name was used.
• filter_too_narrow — WHERE clause matched 0 rows.
• empty_upstream — a depends_on step returned nothing.
• wrong_source — the answer lives in a different store.
- target_sources_too_narrow — the SQL referenced a table whose store is NOT in this step's sources list. Status will start with "SQL ROUTING ERROR".
• other — describe briefly.
Causes (TEXT-side):
• query_too_specific — search query was too narrow; 0 hits or off-topic.
• query_too_generic — search query missed the key entity; hits drift.
• wrong_text_source — picked the wrong text store (multiple available).
• insufficient_evidence — top hits exist but don't contain the answer.
Output JSON only:
{{ "cause": "schema_error" | "filter_too_narrow" | "empty_upstream" | "wrong_source" | "target_sources_too_narrow" | "query_too_specific" | "query_too_generic" | "wrong_text_source" | "insufficient_evidence" | "other", "explanation": "one sentence" }}
User
Step: {step_json}
action: {action}
output_size: {N | 'scalar'}
status: {status}
auto_reason: {auto_reason}
Table 39: Prompt for Plan Revision.
Plan Revision
System
A step in the plan failed. Rewrite the plan from the failed step onward (the failed step + all subsequent steps). Prior successful steps are kept as-is.
Each revised step MUST follow the same sql_template / search_template + {{prev_N}} placeholder schema as the original plan. Dense-retrieve steps may also include metadata_filter (see PLAN_TEMPLATE RULE 3b) — use it to hard-bind an entity already resolved by a prior step.
Common fixes by cause:
• schema_error — use the correct table / column name (see DATA STORES below).
• filter_too_narrow — relax the WHERE clause; LIKE '%...%' or drop a restrictive condition.
• empty_upstream — find an alternative bridge entity, or fold upstream logic into a single JOIN.
• wrong_source — switch to a different store from DATA STORES.
- target_sources_too_narrow — expand the step's sources list to include the missing store, OR rewrite the SQL to use a table that IS already in sources. Do not silently drop the reference.
• query_too_specific — broaden the search_template (drop a keyword).
• query_too_generic — add the entity name from the user query into the search_template.
• wrong_text_source — switch to a different TEXT store from DATA STORES that better fits the question topic.
• insufficient_evidence — re-formulate the search_template to target the missing fact (e.g., add the relation word from the user query).
DATA STORES (use these names verbatim): {db_block}
Output JSON only:
{{ "new_remaining_steps": [<step objects>], "rationale": "one short sentence" }}
User
User query: {query}
Failed step (index {index}): {failed_step}
Diagnose: {diagnosis}
Prior outputs (compact): {prior_step_outputs}
Original full plan: {plan}
Table 40: Prompt for Final Answer Generation.
Final Answer Generation
System
Produce the final answer to the user query from the executed plan's outputs.
How to choose the answer:
-
Identify what TYPE of value the query asks for (a name, date, number, count, passage). Call this the "answer slot".
-
Walk the steps in order. Identify which step's INTENT matches the answer slot — that step's OUTPUT is the answer.
-
SINGULAR vs PLURAL — decide BEFORE writing the answer:
• SINGULAR cues: "the highest", "the most", "which one", aggregations. Pick ONE row.
• PLURAL cues: "which products / categories / buyers / texts / reviews", "list", "all", "each", "every", "for each". Return ALL matching rows as a comma-joined list.
Output style — STRICT:
- "answer" is a STRING. For singular → bare value (name, number, date, short phrase). For plural → comma-joined bare values. No prefix, no full sentences.
• For dates use the format that appears in the context.
• For numbers return a bare number.
- NEVER return an internal ID (FOO-..., ORD-...) when the query asks for a name. Cross-look earlier steps for the corresponding name.
Dense-retrieve outputs (rule for using retrieved docs):
-
Each retrieved doc has two parts: metadata (structured fields: buyer_name, seller_name, product_name, review_category, review_rating, broadcast_datetime, inquiry_type, etc.) and content (free-form narrative text like review text, dialogue, broadcast script).
-
Decide where the answer lives BEFORE looking. If the answer slot is a NAME / ENTITY / CATEGORY / RATING / DATE (a structured field), read it from the metadata of the single best-matching doc — NOT from the content text body. If the answer slot is a QUOTE / OPINION / EXPLANATION / REASON / DESCRIPTION (free-form prose), read it from the content text body of the relevant doc — quote or paraphrase the relevant span; never return an identifier-shaped token.
-
When multiple persons appear in the same passage (e.g., a review written BY buyer X about seller Y for product Z), use the metadata role labels to pick the entity that matches the question's role.
-
The answer is ALWAYS user-facing prose or a metadata value. Never return a list of capitalized identifier tokens (e.g. FOO-XXX-0001).
INSUFFICIENT is a LAST-RESORT fallback. Return it only when NO step produced any useful output.
Output JSON only:
{{ "answer": "...",
"evidence": [[{"step": <int>, "source": "...", "snippet": "..."}]},
"confidence": "high|"medium|"low"}
User
User query: {query}
Executed plan:
[step {n}] INTENT: {sub_query}
STATUS: {status}
OUTPUT ({type}): {step_output}
{...one block per executed step ...}
Produce the final JSON answer.