NL-to-SQL Query Builder
Convert natural language queries into SQL with intent classification, schema context, confidence scoring, interactive disambiguation, and audit logging acros...
NL-to-SQL Query Builder Skill for OpenClaw
Overview
Production-grade natural language to SQL system based on battle-tested patterns from serving 100+ daily users across 10+ business domains.
What's Inside
Core Scripts
query_classifier.py- Classify query intent (metric, list, comparison, trend)schema_context_builder.py- Generate rich schema context from database metadataconfidence_scorer.py- Calculate confidence based on schema match, ambiguity, edge casesdisambiguation_ui.py- Flask components for user clarificationfallback_handler.py- Route low-confidence queries to human reviewaudit_logger.py- Track all queries and interpretations
Features
- Multi-domain support: Tested across 10+ industries
- Confidence thresholds: 85% auto-execute, 60% clarify, below 60% human review
- Disambiguation flow: Interactive UI for clarifying ambiguous queries
- Error recovery: Automatic retry with modified prompts
- Full audit trail: Compliance-ready logging
Quick Start
pip install -r requirements.txt
python schema_context_builder.py --db-url your_db --output schema.json
python query_classifier.py --query "Show me sales by category" --schema schema.json
Pricing
$149 one-time (lifetime updates included)
Requirements
- Python 3.10+
- OpenClaw agent framework
- Database with metadata access
Built by: Abhi (100+ daily users production system)
Related skills
- Downloads
- 792All time
- Security audit
- Review
- Last updated
- 5mo ago
- Current version
- v1.0.0
- License
- MIT-0
