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¶
| Feature | Description |
|---|---|
| Schema Awareness | Understands table relationships and data types |
| Query Optimization | Generates efficient SQL with proper indexes |
| Multi-Model Support | OpenAI, Anthropic, local models |
| Agentic Enhancements | Iterative refinement for complex queries |
| WASM Procedures | Custom stored procedures in WASM |
Documentation¶
| Document | Description |
|---|---|
| NL2SQL_USER_GUIDE.md | Complete user guide |
| AGENTIC_ENHANCEMENTS.md | Advanced agentic features |
| PRODUCTION_DEPLOYMENT_GUIDE.md | Production setup |
| WASM_STORED_PROCEDURES.md | WASM procedure guide |
Related¶
- 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