Natural Language to SQL Generation via Domain Mapping

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database query tools face challenges in generating accurate and complete queries across disparate systems and varying data storage models, often resulting in unrelated or incomplete data due to the need to search across entire systems.

Innovation Solution

A computer-implemented system that uses natural language processing to generate SQL queries on a custom enterprise data warehouse. This system includes a user interface for receiving natural language queries, an attribute extractor to identify relevant attributes, a domain mapper to map these attributes to relevant domains and sub-domains, and a combination of semantic, hybrid, and graph retrievers to perform similarity searches within a standardized metadata store.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the system searches across the entire database system to find data, then the search coverage is complete, but the search results include unrelated data and take excessive time

Engineering Contradiction:
Improvesearch completenessVSAvoidquery generation time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent segments the database search process by first extracting attributes from the user query, then mapping them to relevant domains and sub-domains. The retriever then performs similarity searches only within these specific domains rather than searching the entire database, thereby reducing search time while maintaining relevance through domain-specific filtering

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary attribute extraction and domain mapping before executing the actual data retrieval. By pre-processing the user query to identify relevant attributes and map them to appropriate domains, the system prepares the search parameters in advance, enabling faster and more targeted searches without requiring full-system scans

Inventive Principle:
Principle #10Preliminary action

2Ease of manufacture

If the system uses separate databases for different business units, then the data organization is structured, but a search in one database does not yield complete results

Engineering Contradiction:
Improvedata organization structureVSAvoidsearch result completeness
Core Design Contradiction:
Ease of manufactureVSReliability

Solution Approach 1:

The patent implements a universal search mechanism that operates across multiple databases and business units through a standardized metadata store. The domain mapper and retriever work together to search across all databases while filtering by relevant domains, enabling complete search results that span multiple organizational silos without requiring a single monolithic database

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The standardized metadata store acts as an intermediary layer between the user query and the various business unit databases. It provides a unified interface for searching across disparate databases while maintaining the organizational structure, allowing complete results to be aggregated from multiple sources through a single search operation

Inventive Principle:
Principle #24Intermediary (Mediator)

3Measurement precision

If the system requires extensive pre-processing of proprietary data models and metadata, then the query generation accuracy is improved, but the system complexity increases

Engineering Contradiction:
Improvequery generation accuracyVSAvoidsystem processing complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent transforms proprietary data models and metadata into a standardized format through the domain mapper. By changing the representation parameters of the data models to a standard schema, the system reduces the complexity of handling diverse proprietary formats while maintaining the precision needed for accurate query generation through consistent attribute extraction and mapping

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS12321343B1Natural language to SQL on custom enterprise data warehouse powered by generative artificial intelligence
Publication Date: 2025.06.03 MORGAN STANLEY SERVICES GROUP INC
  • US12321343B1 patent drawing
  • US12321343B1 patent drawing
  • US12321343B1 patent drawing

AI summary

Systems and methods for translating natural language to SQL on a custom enterprise data warehouse powered by Generative AI. With an embodiment of the present invention, a natural language question may be converted to a meaningful and accurate database query, e.g., SQL query, relevant to tables existing in an enterprise data warehouse. An embodiment of the present invention is directed to a comprehensive approach of transforming a natural language query to a focused SQL query using domain specific data models across firmwide metadata systems and data systems. In response to a user query, an embodiment of the present invention performs metadata analysis, targeted data retrieval and then SQL generation. An embodiment of the present invention may apply data warehousing standards and guidelines followed in the enterprise and provide a plug-and-play type architecture and solution that is scalable to large warehousing and other systems.