AI Cloud Architect

Text-to-SQL solution powered by Amazon Bedrock

AWSHow-to by Monica Jain, Damien Forthomme, Meng Feng, Matheus Cachoeira, Norman Braddock, Sujit Narapareddy and Terry DingAWS Artificial Intelligence Blog

In this post, we show you how to build a natural text-to-SQL solution using Amazon Bedrock that transforms business questions into database queries and returns actionable answers.

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

A reference design where Bedrock models and AgentCore agents turn business questions into SQL, validate it, run it on Redshift, and return natural-language answers.

Who it is for

Data and cloud teams on AWS who want business users to query warehouse data in natural language without bypassing row-level security.

Key points

  • Uses GraphRAG with Neptune and OpenSearch for business context, and validates generated SQL with deterministic AST checks before execution.
  • AWS reports simple queries generate in about 3-5 seconds in its deployment; actual times depend on warehouse, model and graph size.
  • Row-level security filters are injected into generated SQL before execution.

The same at other vendors

Timeline

  1. Customer storyHow TP ICAP transformed CRM data into real-time insights with Amazon Bedrock · AWS · Customer story
  2. This postText-to-SQL solution powered by Amazon Bedrock

Go deeper