The difference
Most text-to-SQL and NL-to-SQL tools generate SQL and hope for the best. Here is what NLQueries does instead.
01
Use ask to generate and validate SQL without executing it, or query to run it directly. Either way, you always see the exact SQL that was produced.
02
NLQueries builds a YAML knowledge base from your actual query history, not just static schema introspection. It learns how your team refers to your data and which joins matter.
03
Ingest PDFs, Word docs, Excel sheets, Notion pages, or Confluence spaces alongside your database. Ask a question that spans both, and get one coherent answer.
04
NLQueries exposes a full MCP server. Point Claude Desktop, Cursor, or any MCP-compatible client at it and query your database from the assistant you already use.
Capabilities
Storage
Eight dedicated connectors: PostgreSQL, MySQL, Snowflake, BigQuery, Redshift, SQL Server / Azure SQL, DuckDB, and SQLite, plus a generic SQLAlchemy connector for MariaDB, Oracle, and any other SQL database from a connection URL. Register once via nlqueries connect, then reference by alias.
Ingestion
PDF, Word (.docx), Excel (.xlsx), Notion pages, and Confluence spaces. Documents and schema live in the same knowledge base.
Intelligence
A YAML file that grows with real usage: schema, relationships, column descriptions, and common query patterns. Editable by hand or updated automatically.
Safety
nlqueries ask validates SQL without touching your database. nlqueries query executes it. You choose which one to run.
Performance
Questions with cosine similarity of 0.97 or higher against a prior question skip the LLM and the database round-trip, typically answering in under 50ms.
Integration
Exposes a full Model Context Protocol interface. Claude Desktop, Cursor, and any MCP-compatible client can query your database as a native tool call.
Observability
nlqueries kb-stats shows which tables and columns are well-represented in the knowledge base and which need enrichment.
Developer
nlqueries query "..." in the terminal. from nlqueries.orchestrator import MultiAgentOrchestrator in your code. Both first-class.
Get started
Pick whichever fits your workflow. Full setup guide in the docs.
License
nlqueries-core is released under the Business Source License 1.1 (BSL 1.1). Here is exactly what that means:
BSL lets us develop the project sustainably while keeping the source fully readable and auditable from day one. Read the LICENSE file directly before relying on this summary for a production decision.
Source is public and readable now
You can read, audit, fork, and run the code for development and evaluation immediately.
Production use is permitted, with one carve-out
You may run NLQueries in production. The one thing you can't do is offer it to third parties as a hosted or managed service. Individual and non-commercial self-hosted use is unrestricted.
Converts to Apache 2.0 on June 4, 2030
On the change date, or the fourth anniversary of a given version's release (whichever comes first), the license converts to Apache 2.0 automatically. No action required on your part.
Core vs. Enterprise
Enterprise adds team infrastructure on top of it, not features held back from Core.
Feature
Core
open source
Enterprise
proprietary
Enterprise only
Enterprise pricing on request. [email protected]
FAQ
NLQueries is an open source, self-hosted natural language to SQL (NL2SQL) engine. It converts plain-English questions into SQL, validates that SQL against your real database schema before it runs, executes it read-only, and returns the answer. It runs as a CLI, a Python library, and an MCP server.
Yes. Natural language to SQL, NL2SQL, NL-to-SQL and text-to-SQL all describe the same task, and NLQueries does it with one difference from most tools: generated SQL is parsed and checked column-by-column against the live schema with sqlglot before anything executes, and you can preview the SQL with nlqueries ask without touching the database.
Dedicated connectors for PostgreSQL, MySQL, Snowflake, BigQuery, Amazon Redshift, SQL Server and Azure SQL, DuckDB, and SQLite, plus a generic SQLAlchemy connector for MariaDB, Oracle and any other database reachable by connection URL.
Three things. It builds its knowledge base from your real query history, not just a schema dump, so it learns the joins and naming your team actually uses. It validates SQL against the live schema and runs it read-only with a timeout. And it exposes everything as an MCP server, so Claude Desktop, Cursor and other assistants can query your database as a native tool instead of you pasting SQL between windows.
Yes. Run nlqueries mcp-server and point any Model Context Protocol client at it. The assistant gets validated SQL results as tool calls, with OIDC authentication and per-tool authorization available for network transports.
The core is free to use and its source is public on GitHub under the Business Source License 1.1, which permits production and self-hosted use but not offering it as a hosted service to third parties. Every version converts to Apache 2.0 four years after release, and the whole project converts on June 4, 2030. Enterprise adds a web UI, SSO, admin and audit tooling on top of the same core.
The question and the relevant slice of the knowledge base (schema, column descriptions, example queries) are sent to the LLM you configure so it can write SQL. Query results are returned to you from your database directly. It is self-hosted, so you choose the model provider and what leaves your network.
Per-database setup for PostgreSQL, MySQL, Snowflake, BigQuery, Redshift, SQL Server, DuckDB and SQLite.