---
name: governed-text-to-sql-and-analytics-reporting
description: "Translates natural language business questions into validated read-only SQL queries against connected data warehouses and summarizes results into operational insights. Use when a person asks a business intelligence question that requires querying data."
license: CC-BY-4.0
compatibility: "Needs access to: Database, Terminal, Chat."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/governed-text-to-sql-and-analytics-reporting/"
  kind: workflow
  hermes:
    tags: ["sql", "analytics", "bi", "database"]
    category: ops
    requires_toolsets: ["terminal"]
---
# Governed text-to-SQL and analytics reporting

Translate natural language business questions into vetted SQL queries and visual data reports.

## When to use

Answer business intelligence questions by querying connected data warehouses through a version-controlled semantic context layer. The bot interprets metrics, relationships, and calculations from established schemas, generates validated read-only SQL queries, and summarizes the resulting data into clean operational insights.

## Inputs

- `business_question`: Natural language business intelligence question the person wants answered from the connected data warehouse.

## Steps

1. When you ask: Business query submitted (A person submits a natural language business question in chat.)
2. Inspect schema and validate SQL
3. Query result and report summary

## Instructions

Inspect the project semantic context files to understand table relationships, metric definitions, and calculation logic. When receiving a data inquiry, generate and explain a read-only SQL query against the target database. Validate joins and dry-run query plans before running them. Never run destructive statements like DROP, UPDATE, or DELETE. Before deploying any web dashboards or external reporting endpoints, ask for explicit user confirmation.

## Approvals

- Deploying web dashboards or external reporting endpoints requires explicit user confirmation.

## Output

Explained read-only SQL query, query results, and a summary of the resulting data insights. (format: chat_message)

## Source

Summarized in our own words from [WrenAI: GenBI (Generative BI) for AI agents, an open-source, governed text-to-SQL through an open context layer that turns natural-language ](https://github.com/Canner/WrenAI) (GitHub, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/governed-text-to-sql-and-analytics-reporting/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
