Skip to main content

Text-to-SQL

Text-to-SQL translates natural language questions into SQL queries against the tenant's data. It uses the ontology model to understand business terminology and Trino to execute the resulting queries.

:::note Bundle in progress The aws/text-to-sql bundle is under development. This page will be updated with deployment and configuration details when the bundle is available. :::

Role in the Stack

Text-to-SQL sits downstream of the Ontology Backend and upstream of Trino:

  1. A user asks a question in natural language via the Cogrion UI.
  2. Text-to-SQL retrieves the relevant ontology context (entities, metrics, schema) from the Ontology Backend.
  3. A language model generates a SQL query based on the question and context.
  4. The query is executed against Trino and results are returned.

Go Deeper