NL2SQL Core Engine — 6 Pillars

Manage NL2SQL schema linking, ambiguity detection, and regression testing.

3|Updated May 3, 2026
One-click install
npx skills add https://github.com/ductoanoxo/Agent_SQL --skill nl2sql-core-engine-6-pillars
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: NL2SQL Core Engine — 6 Pillars
Source: https://github.com/ductoanoxo/Agent_SQL/tree/main/docs_mainengine/skills/nl2sql-6pillars
Command: npx skills add https://github.com/ductoanoxo/Agent_SQL --skill nl2sql-core-engine-6-pillars

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you keep an NL2SQL multi-agent pipeline accurate and safe as your database schema, prompts, and LLM models evolve.

Core Features & Use Cases

  • Schema Linking & Value Profiling: Maps user intent to the correct tables/columns and injects value profiles so generated SQL uses exact enum values.
  • Ambiguity Detection: Tunes the Gatekeeper rules to correctly classify valid analytical questions vs unsafe/invalid requests.
  • Generation Trace: Extends intermediate outputs so you can understand why the pipeline chose a specific query plan and SQL.
  • Retry & Repair: Recovers from SQL dialect issues using a centralized repair/patch mechanism.
  • Evaluation Suite (23-case): Runs an automated regression test set and produces a test_report.json to prevent prompt/schema regressions.

Quick Start

Use the NL2SQL Core Engine — 6 Pillars Skill when you change schema, prompts, synonyms, or the LLM, then run the evaluation suite to confirm 23/23 PASS and catch regressions early.

Frequently Asked Questions about NL2SQL Core Engine — 6 Pillars

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent NL2SQL accuracy regressions when switching LLM providers?

Prevent NL2SQL regressions when switching LLM providers by running a 23-case automated evaluation suite to generate test_report.json, verifying the multi-agent pipeline maintains 23/23 PASS before deploying changes.

How does schema linking improve NL2SQL query generation?

Schema linking improves NL2SQL query generation by mapping user intent to correct tables and columns while injecting value profiles, ensuring generated SQL uses exact enum values and reducing invalid query execution.

How do I fix SQL dialect errors in an NL2SQL pipeline?

Fix SQL dialect errors in an NL2SQL pipeline by applying centralized repair patches and regex modifications for specific date phrases, enabling the system to self-recover from dialect-breaking syntax issues automatically.

Can I automate NL2SQL prompt tuning and security validation together?

Automate NL2SQL prompt tuning and security validation together by configuring Gatekeeper validation rules with injection test cases like DROP TABLE, automatically classifying valid analytical questions versus unsafe requests.

What is NL2SQL ambiguity detection and when do I need it?

NL2SQL ambiguity detection is the process of tuning Gatekeeper rules to classify valid analytical questions versus unsafe or invalid requests, needed when extending synonyms or adding schema updates to maintain pipeline safety.

Why does my NL2SQL pipeline fail after adding new database tables?

Your NL2SQL pipeline fails after adding new tables because schema linking, value profiles, and prompt schema text require manual updates, which must be verified by running test_pipeline.py to achieve 23/23 PASS.