Despite the advancement of foundation model, which can generate complex SQL statement, the main issue is the foundation model lacks the understanding of organization's data schema. Each organization has different naming convension, as such we need a way to feed the data schema and make the foundation model understands it. This repository provides the use case example of using Anthropic Claude's multi-modal capabilities to do NLQ (or Natural Language Query). By feeding the database's entity relationship diagram (or ERD) into image channel and user's question into text channel, Anthropic Claude foundation model can understand your data schema and use those information to generate the specific SQL according to the user's question.
This repository provides the end-to-end example from getting the user's question, generating SQL query, querying the data lake using Amazon Athena, and generating more natural outputs instead of table-like responses from Amazon Athena.
Python programming language and boto3 SDK, please see here for boto3 documentationboto3 library (you can do this by pip install --upgrade boto3)
Below is the architecture diagram of this solution.

See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.