SuperAPI AI Directory

nlqueries

Self-hosted natural-language-to-SQL engine with validation for PostgreSQL, MySQL, Snowflake, BigQuery and DuckDB, plus document QA and semantic caching.

Open website

About this tool

NLQueries Core is an open-source natural language to SQL (NL2SQL) engine. Its main goal is to convert questions posed by users in natural language into validated SQL queries, and to build a self-updating YAML knowledge base around the database schema and query history. It also provides an MCP server, enabling AI assistants such as Claude and Cursor to directly invoke its capabilities.

In terms of main capabilities, the engine supports converting English questions into validated SQL and automatically generating and continuously updating a YAML knowledge base based on the database schema and query history. It can also answer questions from documents such as PDF, Word, Excel, Notion, and Confluence, and can fuse database queries and document Q&A into a single hybrid answer. Official materials mention support for databases such as PostgreSQL, MySQL, Snowflake, BigQuery, and DuckDB.

In terms of usage, the project requires Python 3.11–3.14. Three installation options are provided: Option A is Docker (recommended), pulling the published nlqueries/core image from Docker Hub, with no need to clone the repository, only a compose file; you need to create a .env file containing an LLM key, a Qdrant key, and an MCP token, all three of which are required, and compose refuses to start when QDRANT_API_KEY or NLQ_MCP_STATIC_TOKEN is missing. The MCP server is accessed over the network and requires this token: the MCP client connects to http://localhost:8080/sse and sends Authorization: Bearer <your NLQ_MCP_STATIC_TOKEN>. This token has full access permissions; if you need to assign different permissions to different people, refer to docs/mcp-authentication.md. After startup, Qdrant runs on :6333, and the MCP server runs on :8080. CLI commands can be executed against the running stack in a second terminal. Option B is pip install, with the PyPI package name nlqueries-core; some connectors require optional extras; PostgreSQL and SQLite require no additional dependencies, and the generic sqlalchemy connector requires the driver specified by its URL. Option C is installing from cloned source, without Docker, suitable for contributing code or running unreleased changes.

In terms of usage details, subsequent context is enabled by default; a new session can be started with --new-session, or disabled for a single question with --no-session. See docs/getting-started.md for the complete getting-started guide.

Applicable scenarios include: developers and data teams who need to query databases in natural language, MCP client users who want AI assistants to directly access databases and documents, and organizations that need a self-hosted, commercially deployable NL2SQL solution.

In terms of limitations and licensing, the project uses the Business Source License 1.1, converting to Apache 2.0 no later than June 4, 2030. This license sets that date, and each version also converts on the fourth anniversary of its first release, whichever comes first; therefore, versions first released before June 4, 2026 will convert on their own anniversary, earlier than the fixed date. Until then, the license grants production use (including commercial and self-hosted), with one exception: NLQueries Core may not be offered to third parties as a hosted or managed service. Personal and non-commercial self-hosted deployments are not restricted. LICENSE is the authoritative basis. All contributors must sign a CLA before a PR is merged.