About this project
This repository provides a reference architecture for a data-residency-compliant chatbot that answers plain-English questions from structured data in Aurora PostgreSQL without requiring users to write SQL. All data and AI inference remain within a single AWS Region (ap-south-1, Mumbai). The pattern is demonstrated with a rooftop-solar subsidy program using fully synthetic sample data, but the residency controls and governed text-to-SQL security design are applicable to other sectors and geographies.
The solution combines single-Region residency enforcement at every layer (model invocation, network, hosting) with governed, whitelist-validated text-to-SQL on Amazon Bedrock AgentCore. Key components include AWS WAF for firewall protection, an Amplify-hosted browser UI, API Gateway (REST or WebSocket), an Agent Lambda running a Strands agent, Amazon Bedrock for in-region ON_DEMAND inference, the AgentCore Gateway exposing four read-only query tools, a Tool Lambda that builds parameterized SELECT-only statements, and Aurora PostgreSQL Serverless v2 in private subnets. AgentCore Memory provides conversational context for follow-up questions.
The system guarantees that every number in an answer comes from a live database query rather than model hallucination, and that no raw data leaves the Region. The repository includes deployment options via one-click CloudFormation or a Python deploy script, with preflight checks that reject cross-region inference profiles. Production considerations cover connecting to an existing database by reusing its VPC and pointing the tool at a read replica. Documentation includes architecture details, deployment guidance, and a preflight checklist. The project is licensed under MIT-0.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.