Skip to content

NL2SQL (Natural Language to SQL)

NL2SQL (Natural Language to SQL)

Convert natural language queries to SQL with AI-powered understanding.

Overview

HeliosDB NL2SQL enables users to query databases using natural language, automatically translating questions into optimized SQL queries.

Quick Start

-- Enable NL2SQL
SET nl2sql_enabled = true;
SET nl2sql_model = 'gpt-4';
-- Query with natural language
NL2SQL "Show me all customers who made purchases over $1000 last month";
-- Result: Automatically generated and executed SQL
-- SELECT c.* FROM customers c
-- JOIN orders o ON c.id = o.customer_id
-- WHERE o.total > 1000
-- AND o.date >= DATE_SUB(NOW(), INTERVAL 1 MONTH);

Key Features

FeatureDescription
Schema AwarenessUnderstands table relationships and data types
Query OptimizationGenerates efficient SQL with proper indexes
Multi-Model SupportOpenAI, Anthropic, local models
Agentic EnhancementsIterative refinement for complex queries
WASM ProceduresCustom stored procedures in WASM

Documentation

DocumentDescription
NL2SQL_USER_GUIDE.mdComplete user guide
AGENTIC_ENHANCEMENTS.mdAdvanced agentic features
PRODUCTION_DEPLOYMENT_GUIDE.mdProduction setup
WASM_STORED_PROCEDURES.mdWASM procedure guide
  • Conversational BI: /docs/guides/user/CONVERSATIONAL_BI_USER_GUIDE.md
  • SQL Native RAG: /docs/guides/user/SQL_NATIVE_RAG_USER_GUIDE.md

Status: Production Ready Version: v7.0