The ability to automatically convert natural language (NL) queries to structured query language (SQL) queries (NL2SQL) can improve the accessibility of databases to end users. This disclosure describes a standardized NL2SQL architecture pattern (including building blocks) for querying structured data using natural language. The probabilistic nature of large language models (LLMs) is leveraged to generate SQL queries by understanding the metadata of structured databases. The generated SQL queries match the dialect of the database, including its version and package, and are validated and tested for accuracy.

Creative Commons License

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.