# The Best Text-to-SQL Tools in 2026

> Text-to-SQL tools compared on how they ground the model in your schema, what accuracy really means, read-only safety, deployment, licensing, and pricing model.

Text-to-SQL tools differ less in model quality than in how they ground the model: RAG over saved question-SQL pairs and documentation (Vanna), Python and SQL over dataframes (PandasAI), curated catalog context (Databricks Genie), a governed semantic layer compiled to SQL (ThoughtSpot Spotter), or a notebook that makes you accept every cell (Hex).

Text-to-SQL tools in 2026 differ far less in model quality than in how they ground the model in your data. One retrieves known-good queries, one generates Python and SQL against dataframes, one reads a governed catalog, one refuses to write free-form SQL at all, and one makes you approve every cell. That choice, not the model behind it, decides whether the answers hold up. This page compares six routes on grounding, accuracy, safety, deployment, licensing, and pricing model. The definitions live in [text-to-SQL](/glossary/text-to-sql) and [semantic layer](/glossary/semantic-layer); the Claude-specific walkthrough is [text-to-SQL with Claude](/guides/analytics/text-to-sql-with-claude), and the wider stack is in [Claude for data analysis](/guides/analytics/claude-for-data-analysis).

*Last reviewed: September 2026.*

## The summary table

| Tool | How it grounds the model | Deployment | License | Pricing model |
| --- | --- | --- | --- | --- |
| [Vanna](/tools/vanna) | RAG over agent memory: saved question-SQL pairs and documentation | Self-hosted, managed cloud, enterprise | MIT (repo archived) | Open source plus paid cloud tiers |
| [PandasAI](/tools/pandasai) | Generated Python and SQL over connected data | Python library | MIT Expat, separate EE terms | Open source plus enterprise edition |
| [Databricks Genie](/tools/databricks-genie) | Catalog metadata, instructions, example SQL, trusted assets | Inside Databricks | Proprietary | Consumption, free for users into 2027 |
| [ThoughtSpot Spotter](/tools/thoughtspot-spotter) | Search tokens against a governed semantic layer | SaaS and embedded | Proprietary | Per user, credits, or custom |
| [Hex](/tools/hex) | Connections, semantic models, workspace rules, notebook context | SaaS | Proprietary | Freemium, per-Editor plus credits |
| [Claude Code](/tools/claude-code) + [Postgres MCP](/tools/postgres-mcp) | Live schema introspection and your repo's own SQL | Your machine | MIT (the MCP server) | Paid Claude plan or API usage |

## How each one grounds the model

**Vanna** is the clearest blueprint, which is why it is worth understanding even if you buy something else. Version 2.0 replaced the old `train()` workflow with agent memory: every successful tool usage is saved to a vector store, and `save_tool_usage()` and `save_text_memory()` let you seed it with known-correct question-and-SQL pairs and written business documentation up front. When a new question arrives, similar past examples are retrieved by semantic similarity into the prompt. The question-SQL pairs carry the most signal, because a correct query encodes joins, filters, and business logic that no schema dump contains. One thing to check before adopting: the `vanna-ai/vanna` GitHub repository was archived by its owner on March 29, 2026 and is read-only, with the last release, 2.0.2, dated February 2, 2026, while the documentation and the commercial Vanna Cloud offering are still live.

**PandasAI** takes the library route. It interprets a natural language query, translates it into Python or SQL depending on the data source, and executes it, which makes it a fit when the data is already a dataframe or a file rather than a warehouse. Grounding comes from the schema of what you connected plus whatever context you pass in code.

**Databricks Genie** grounds on the catalog. Databricks is unusually specific about what works: SQL expressions and example queries should take precedence over plain-text instructions, quality table and column descriptions in the catalog are described as critical, and you should start with five or fewer tables and stay under thirty, using metric views and pre-joined views to simplify the model. Curated context, in other words, not prompt engineering.

**ThoughtSpot Spotter** changes the shape of the problem. Instead of asking a model to write SQL, it translates the question into search tokens grounded in Spotter Semantics, its governed semantic layer, and compiles those into SQL that enforces join logic, hierarchies, and security. The vendor's claim is traceability: every answer maps back to approved definitions rather than to a model's guess.

**Hex** grounds its Notebook agent in the data connections and semantic models the user can access, plus a workspace rules file and the current notebook's own code and outputs. The differentiator is the review model: generated SQL and Python arrive as cells you confirm or undo individually.

## Accuracy, and why benchmarks mislead

You will find leaderboards claiming high execution accuracy for text-to-SQL. Treat them as a floor on what is possible rather than a forecast of what you will get, for three reasons.

Benchmark schemas are tidy. Columns are named what they mean, one table holds the concept, and there is no fiscal calendar or soft-delete flag. Benchmark questions are unambiguous by construction, while real ones omit the time range, the channel, and which of three revenue definitions you meant. Databricks names this directly in its own guidance, recommending that an agent be configured to ask a clarifying question when a request lacks a time range or a KPI. And execution-match scoring counts a query correct whenever its result set matches the reference, which quietly passes a wrong join that happens to produce the right number on that dataset.

The useful substitute takes an afternoon: collect twenty real questions your team asked last month, write the correct SQL for each yourself, and check what the tool produces against your query, not just against your number. Reuse that set every time you change models, prompts, or context. [Check an AI data analysis](/guides/analytics/check-an-ai-data-analysis) is the review routine that goes with it.

## Read-only safety

Every tool here should reach your database through a role that cannot write. Prefer a layer that enforces it rather than one that requests it. Postgres MCP Pro is the clearest example: its restricted mode runs statements inside a read-only transaction, parses SQL to validate it, and blocks `COMMIT` and `ROLLBACK` so the read-only wrapper cannot be escaped, while unrestricted mode with full read/write access exists for development. It also exposes `explain_query` for execution plans, index tuning, and health checks.

```bash
claude mcp add postgres -- uvx postgres-mcp --access-mode=restricted
```

The governed platforms handle this differently: Genie inherits Unity Catalog permissions, and Spotter enforces security in the compiled query. Either way, cap result sizes and log every generated statement, because the query log is the only record of what an agent actually asked.

## Deployment, licensing, and pricing model

If text-to-SQL is going into a product, read the license before the docs. Vanna is MIT. PandasAI is MIT Expat for the main codebase, with its enterprise-edition directory carried under separate terms in the same LICENSE file, so a blanket "it's MIT" is wrong for the whole repository. Postgres MCP Pro is MIT.

On the commercial side, Databricks bills Genie by consumption, with Genie One and Genie Agents free for user traffic through January 31, 2027 and pay-as-you-go afterwards, Genie Code already pay-as-you-go, and compute billed separately throughout. ThoughtSpot sells Essentials per user, Pro on credits, and Enterprise on custom terms, and states that it does not meter LLM tokens. Hex is freemium with per-Editor paid plans plus credit grants that agent runs consume. Figures live on the tool pages.

## The DIY route

[Claude Code](/tools/claude-code) with a read-only [Postgres MCP](/tools/postgres-mcp) server is the version most analysts should try first. The agent introspects the live schema, reads the SQL already in your repository as its examples, writes a query, explains it, and leaves a file behind. You get the grounding advantages of Vanna's approach without building a training pipeline, because your repository already contains the known-good queries. What you do not get is governance, sharing, or a metric anyone else agreed to, which is exactly when you graduate to a semantic layer. [Claude Code for data analysts](/guides/analytics/claude-code-for-data-analysts) covers the setup.

## How to choose

Building a feature: Vanna or PandasAI. Already on Databricks: Genie, after you document five tables properly. Hundreds of business users: Spotter, and budget for the semantic modeling rather than the license. A team of analysts: Hex. One analyst and a warehouse: the terminal route above. The full stack roundup is [the best AI tools for data analysts in 2026](/guides/comparisons/best-ai-tools-for-data-analysts-2026), and the [analyst hub](/for/analysts) collects the rest.

## Sources and further reading

- [Vanna 2.0 documentation](https://vanna.ai/docs/) — Vanna
- [vanna-ai/vanna on GitHub](https://github.com/vanna-ai/vanna) — Vanna
- [PandasAI LICENSE](https://github.com/sinaptik-ai/pandas-ai/blob/main/LICENSE) — Sinaptik
- [PandasAI documentation](https://docs.pandas-ai.com/) — Sinaptik
- [Genie best practices](https://docs.databricks.com/aws/en/genie/best-practices) — Databricks
- [Monitor and understand your Genie cost](https://docs.databricks.com/aws/en/genie/monitor-cost) — Databricks
- [Spotter: the enterprise agent for analytics](https://www.thoughtspot.com/product/agents/spotter) — ThoughtSpot
- [ThoughtSpot plans and pricing](https://www.thoughtspot.com/pricing) — ThoughtSpot
- [Hex Notebook agent](https://learn.hex.tech/docs/explore-data/notebook-view/notebook-agent) — Hex Technologies
- [Postgres MCP Pro](https://github.com/crystaldba/postgres-mcp) — Crystal DBA

---

_Source: https://agentscamp.com/guides/comparisons/best-text-to-sql-tools-2026 — Guide on AgentsCamp._
