Let people ask the database in plain English.

We build natural-language querying, cross-database search and auto-generated dashboards, and we ship our own product, PlaywithDB, on the same ideas.

01Data

What NL2SQL is

NL2SQL translates an everyday-language question into a SQL query, runs it against a database and returns the result. Its appeal is that the people with questions rarely write SQL. Because a wrong query can return a confident but wrong number, a good system shows its SQL so answers can be checked and re-run.

The appeal is simple: the people who have the questions are rarely the people who write SQL. The risk is just as simple: a wrong query returns a confident, wrong number. The build is therefore about making the answer checkable.

02Data

How NL2SQL goes wrong, and how to guard against it

Four failures are worth designing for, each with a control that reduces the risk. For wrong joins or columns, give the model the real schema and column descriptions and show the SQL. For ambiguous questions, clarify or state the assumption. Limit unsafe queries with read-only credentials, limits and timeouts. Store generated queries for re-runs.

Failure modes and a control for each
FailureWhat it looks likeControl
Wrong joins or columnsA plausible number from the wrong tablesGive the model the real schema and column descriptions, and show the SQL
Ambiguous question"Revenue" could mean booked, billed or collectedAsk a clarifying question, or state the assumption in the answer
Unsafe queryA write, a delete or a full-table scan on productionRead-only credentials, query limits and timeouts
Unrepeatable answerNobody can reproduce the resultStore and re-run the generated query
03Data

NL2SQL compared with a BI dashboard

Dashboards fit best when you track the same metrics every week, while NL2SQL fits one-off questions that nobody planned for, which a dashboard would need an analyst to handle. Asking across several databases is possible with cross-database querying. The two can work together: dashboards for recurring numbers, natural-language querying for ad hoc questions.

When each approach fits
NeedDashboardNL2SQL
The same ten metrics, every weekBest fitUnnecessary
A one-off question nobody planned forNeeds an analystBest fit
Ask across several databases at onceOften needs a data project firstPossible with cross-database querying

A team can use both: dashboards for the recurring numbers, and natural-language querying for the questions that arrive on a Tuesday afternoon.

04Data

PlaywithDB: our product, built on the same work

Our AI database platform, PlaywithDB, turns plain English into SQL with explainable steps and re-runnable queries, scans for GDPR, HIPAA, SOC2 and PCI-DSS issues, generates dashboards and queries across PostgreSQL, MongoDB, SQL Server and MySQL. If you need that capability inside your own system instead, we build it for you.

PlaywithDB is the AI database platform from PAI Technologies. It turns plain English into SQL with explainable steps and re-runnable queries, scans for GDPR, HIPAA, SOC2 and PCI-DSS issues, generates dashboards, and queries across PostgreSQL, MongoDB, SQL Server and MySQL. If you want the product, see the PlaywithDB page. If you need the capability inside your own system, we build it for you.

05Data

How a custom NL2SQL pilot runs

A pilot starts by freezing scope to one user journey, choosing the authentication model and drafting a golden question set. The build uses read-only roles, cites the tables behind each answer and logs requests. Hardening adds authentication, rate limits, personal data handling, logging and a runbook, before handover of repositories, infra notes and scripts.

  1. Scope

    Freeze one user journey, such as an analyst asking a question of PostgreSQL data, choose the authentication model and draft a golden question set, even 20 rows.

  2. Build

    Build the slice with read-only roles, cite the tables behind each answer and set expected behaviour on the golden set before polishing prompts. Log every request.

  3. Harden

    Add authentication, rate limits, personal data handling, structured logging and a runbook.

  4. Hand over

    Repositories, infra notes, evaluation scripts and a short walkthrough.

06Data

Governance: who can ask what

Treat natural-language access to live data as carefully as any other access. Sensible controls include read-only credentials with query limits and timeouts, schema visibility by role backed by database permissions, a log of generated queries showing who asked and when, and column descriptions and business definitions that help terms keep agreed meanings.

Natural-language access to live data needs the same care as any other access to it. These controls are sensible for such a system. None of them removes every risk, so test each one.

  • Read-only credentials, with query limits and timeouts, to reduce the risk of a question changing data or overloading production
  • Schema visibility by role, backed by database permissions, because hiding a table from the prompt does not by itself block access
  • Every generated query logged with who asked and when, and stored so it can be re-run
  • Column descriptions and business definitions supplied to the model, to help a word like revenue mean one agreed thing
07Common questions

Questions we get asked.

Straight answers about ai database intelligence.

What is NL2SQL?

NL2SQL stands for natural language to SQL. It lets a person ask a database a question in everyday language. The system writes a SQL query, runs it, and returns the result, ideally showing the query so the answer can be checked.

Is it safe to let AI query a production database?

It can be made much safer, but no setup is free of risk. Use read-only credentials, query limits and timeouts, show the generated SQL, store it so it can be re-run, review access with your security team and test that write attempts fail.

Which databases can you query?

PlaywithDB queries across PostgreSQL, MongoDB, SQL Server and MySQL from a single request. For a custom build, name your databases in the brief so the work can be scoped.

Should we build NL2SQL ourselves or use PlaywithDB?

If you want a ready product for exploring data, compliance scanning and dashboards, look at PlaywithDB. If the capability must live inside your own application, with your own schema, branding and access rules, a custom build is the better fit.

Tell us what you are trying to ship.

Send a one-paragraph brief and we will come back with a recommended approach within one business day.