NLQueries is an open-source and enterprise-grade Natural Language to SQL (Text-to-SQL) engine developed by Theorence Labs. It enables data teams, software engineers, and business stakeholders to query relational databases and cloud data warehouses using plain English without sacrificing security, syntax accuracy, or governance.
Traditional LLM-based SQL generators frequently suffer from schema hallucinations, dialect mismatches, and unsafe query execution. NLQueries solves this by incorporating deterministic Abstract Syntax Tree (AST) validation powered by sqlglot prior to query execution. Every generated query is parsed, validated against the target database schema, transpiled to the exact SQL dialect, and checked against read-only and role-based access guardrails before touching production data.
Key Capabilities:
-Deterministic AST Validation: Parses and validates generated SQL syntax and column references using sqlglot across 20+ SQL dialects.
- Model Context Protocol (MCP) Integration: Exposes database schemas and safe query execution directly to AI agents and IDEs via a standardized MCP server.
- Semantic Caching: Reduces LLM latency and token costs by caching validated natural language intents and their corresponding SQL execution plans.
- Multi-Database Connectors: Supports PostgreSQL, MySQL, DuckDB, Snowflake, BigQuery, Amazon Athena, and Trino out of the box.
- Enterprise Security & Compliance: Architected for strict data governance with zero training on customer data, read-only execution sandboxes, and controls aligned with SOC 2 and ISO 27001 frameworks.