Semantic Layer — Business Context for NL2SQL

Community

Make business terms translate into correct SQL.

Authorductoanoxo
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill prevents NL2SQL from generating incorrect queries caused by missing business meaning that does not exist explicitly in the database schema, such as KPI definitions, domain status mappings, and calculation logic.

Core Features & Use Cases

  • Business glossary for KPI logic: Defines domain terms (e.g., “Khách hàng tiềm năng”, “Doanh thu thuần”) with the exact SQL computation the model must use.
  • Synonym dictionary for entity mapping: Maps Vietnamese business language to the correct tables/columns the model should query.
  • Value profiles and few-shot examples: Supplies allowed categorical/enum values and representative Q→SQL patterns so generated WHERE/GROUP BY/ORDER BY logic follows project conventions.
  • Operational workflow for onboarding new domains/DBs: Provides a repeatable checklist to update synonyms, value profiles, glossary, and examples when new tables or business terminology are introduced.

Quick Start

Ask your AI to generate NL2SQL only after applying the Semantic Layer glossary, synonyms, and value profiles for your target domain, so a question like “Khách hàng tiềm năng tháng này” is translated using the defined KPI SQL instead of being inferred from unrelated fields.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: Semantic Layer — Business Context for NL2SQL
Download link: https://github.com/ductoanoxo/Agent_SQL/archive/main.zip#semantic-layer-business-context-for-nl2sql

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.