ML Model and Foundation Model (FM) Development

Analysts ask a RAG assistant questions such as 'What was total revenue by region last quarter?' The figures live in Amazon Redshift tables. Vector search over exported text chunks returns partial rows, so the totals are wrong. Which retrieval pattern BEST fits these questions?

Show the answer

Correct answerB. Generate SQL from the question and run it against Redshift.

AWhy not this: Hybrid search improves which chunks match but still returns a handful of chunks rather than a total over all rows.

BWhy this is right: A generated SQL query aggregates every matching row in Redshift and returns the exact result.

CWhy not this: More chunks raise the share of rows retrieved but still do not compute a complete, correct total.

DWhy not this: Reranking reorders the retrieved chunks but cannot add the rows that were never retrieved.

Aggregate questions need every matching row, so a structured-data retrieval pattern turns the question into a SQL query and runs it on the warehouse, as Amazon Bedrock Knowledge Bases does for Amazon Redshift. Hybrid search, more chunks or reranking still return a sample of text chunks, not a computed total.