Skip to main content
AI // Conversational BI

“What were last month's top products?” Answered in seconds.

A text-to-SQL assistant translates plain questions into queries on a read-only copy of your data, shows the query, and explains the result.

inference.tracelive

{

"summary"
: "Read-only, shows its SQL, uses your agreed metric definitions.",
"data"
: "Read-only replica",
"transparency"
: "Shows generated SQL",
"consistency"
: "Shared metric layer",
"reviewed_by"
: "a human"

}

Every answer shows its work

question.sqlsql
-- Q: Top 5 products by revenue last month?
SELECT p.name, SUM(l.price_subtotal) AS revenue
FROM sale_order_line l
JOIN product_product pp ON pp.id = l.product_id
JOIN product_template p ON p.id = pp.product_tmpl_id
JOIN sale_order o ON o.id = l.order_id
WHERE o.state = 'sale'
  AND o.date_order >= date_trunc('month', now()) - interval '1 month'
  AND o.date_order <  date_trunc('month', now())
GROUP BY p.name
ORDER BY revenue DESC
LIMIT 5;

Guardrails

Read-only access

Queries run on a replica with a read-only user. No accidental UPDATEs.

Metric definitions

'Revenue' means the same thing in every answer because it's defined once.

Visible queries

Analysts can check, copy, and reuse the generated SQL.

Row-level permissions

Users only see data their role allows.

Why ad hoc questions get stuck

Dashboards answer the questions someone thought of in advance. The rest, such as which customers bought less this quarter or what share of returns came from one supplier, land on an analyst's desk, wait in a queue, and arrive days later. Many never get asked at all.

Text-to-SQL assistants let people ask those questions directly in plain language. The assistant translates the question into a database query, runs it against a safe copy of the data, and shows the result along with the query it used. Analysts stay in control because every answer is inspectable and reusable.

The difference between a toy and a trustworthy assistant is the semantic layer: agreed definitions of revenue, margin, active customer, and the rest. Without it, the model guesses, and two people asking the same question can get two different numbers.

What makes answers trustworthy

Semantic layer

Business terms mapped to tables, joins, and filters once, then reused by every answer.

Schema context

The assistant sees curated table descriptions, not the raw database, which reduces wrong joins.

Visible SQL

Every answer shows the query, so analysts can verify and reuse it.

Evaluation set

Real questions with known answers test the assistant whenever the schema or prompts change.

Read-only replica

Queries never touch production writes and can't slow down operations.

Role-aware data

Row-level rules keep each user to the data their role allows.

Questions it handles well, and less well

TypeExampleFit
Lookups and totalsRevenue by region last quarterStrong
Rankings and trendsTop ten customers by margin this yearStrong
ComparisonsThis month versus the same month last yearStrong with a semantic layer
Multi-step analysisWhich churned customers had support tickets firstGood, with review of the SQL
Judgment questionsWhy did sales drop?Limited: it can show data, not causes

Rollout

  1. Step 01

    Pick the domain

    Week 1

    Start with one area, such as sales or inventory, with a clear owner.

  2. Step 02

    Define metrics

    Week 1–2

    Agree definitions with finance and operations and encode them.

  3. Step 03

    Build and evaluate

    Week 2–4

    Connect the read replica, build the assistant, and score it on real questions.

  4. Step 04

    Pilot

    Week 4–6

    Release to a small group of power users and refine from their questions.

Before you start

  • A read replica or warehouse copy of the data
  • Someone who can sign off on metric definitions
  • A list of questions people ask today
  • A decision on which roles see which data

Common pitfalls we help you avoid

The first pitfall is pointing an assistant at a raw database and hoping for the best. Without curated table descriptions and metric definitions, it guesses joins and filters, and confident wrong numbers erode trust fast.

The second is answering questions nobody can verify. Showing the SQL, the filters used, and the time period on every answer lets analysts and managers check the logic rather than take it on faith.

The third is launching to everyone at once. A pilot with power users surfaces the questions that confuse the assistant, so the semantic layer can be improved before a wider rollout.

What we measure

MeasureWhy it matters
Answer accuracyCorrect results on the evaluation set of real questions
Clarification rateHow often the assistant asks for more detail instead of guessing
Time to answerFrom question to result, compared with an analyst request
Repeat usageWhether people come back, which shows real value

Who does what

We handle

  • Semantic layer and assistant
  • Read-only data access and permissions
  • Evaluation and improvement

Your team handles

  • Metric definitions and sign-off
  • A read replica or warehouse
  • Power users for the pilot

A worked example

Picture a sales director who wants to know which product categories grew fastest in one region compared with last year. Today that means an email to an analyst and a wait. With a conversational assistant, the director asks the question directly and gets a table, a simple chart, and the SQL used.

If the director then asks for the same view by salesperson, the assistant reuses the context. The analyst reviews a sample of answers each week and improves the metric definitions where questions were misread.

Getting ready for a pilot

  • A read replica or warehouse in place
  • Agreed definitions for core metrics
  • A list of real questions from users
  • Clear rules on who may see which data
  • A small group of pilot users

What success looks like

Success is people answering their own everyday data questions in seconds, analysts freed for deeper work, and numbers that match the official reports because they use the same definitions. Accuracy on the evaluation set stays high as new questions are added.

Safe by construction

A system that turns questions into database queries needs firm limits. OWASP's guidance on excessive agency recommends limiting permissions to the minimum necessary, including read-only database roles where writes aren't neededSource [1]. Our conversational BI uses read-only access to a reporting replica, scoped to what each user may see.

Prompt injection, OWASP's top LLM risk, includes instructions hidden in data the model processesSource [2]. Showing the generated query alongside every answer lets people check the logic, and validating queries in code before they run stops anything outside the allowed shape.

Frequently asked questions

Will it give wrong numbers?
It can misread a question, which is why it shows the SQL and uses defined metrics. Evaluation sets track accuracy.
Does it replace our BI tool?
It complements dashboards for ad hoc questions.
Can it access production directly?
We recommend a read replica to protect performance and safety.
Which databases work?
PostgreSQL, including Odoo's database, and most SQL warehouses.
Can it create charts?
Yes, simple charts for the returned results.
Does it work with Odoo's database?
Yes. Odoo runs on PostgreSQL, and we map its tables to business terms so questions don't need to know the schema.
Can it combine ERP data with other sources?
Yes, if they live in the same warehouse or can be queried together. Combining sources is often the first step.
What stops it from running a huge query?
Timeouts, row limits, and query cost checks on the read-only user.
Can answers be saved and shared?
Yes. Useful questions can be saved with their SQL and turned into dashboard tiles.
Is the data sent to an AI vendor?
Only the schema description and the question are needed to write SQL; results can stay inside your environment, and private models are an option.
Can it explain results in plain language?
Yes. Alongside the table and SQL, it can summarize what the numbers show, without guessing at causes.
Can it handle follow-up questions?
Yes. Follow-ups like “now by region” reuse the previous question's context.
What if the question is ambiguous?
It asks for clarification, for example which date range or which definition of customer, rather than guessing.
Can it be used on mobile?
Yes, through a web interface or chat tools like Slack or Teams, with the same permissions as on desktop.
How is it different from a BI tool's own AI features?
It's built around your metric definitions and data permissions, and can span sources your BI tool doesn't cover. If your BI tool's features suffice, we'll say so.
Can it answer questions about targets and budgets?
Yes, if targets and budgets are stored alongside actuals. Comparing performance against plan is one of the most common requests we see from managers.
Can the assistant change data?
No. It uses read-only access, following OWASP's least-privilege guidanceSource [1].
How do we know an answer is right?
Each answer shows the query and the data it used, so anyone can check the logic.

Sources

  1. [1]LLM06:2025 Excessive Agency (opens in a new tab)OWASP Gen AI Security Project, 2025
  2. [2]LLM01:2025 Prompt Injection (opens in a new tab)OWASP Gen AI Security Project, 2025