Natural-Language Database Query Generation With LLM Validation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Users and organizations struggle to harness the full potential of large volumes of data due to the technical expertise required for effective monitoring and insight generation, often necessitating proficiency in proprietary software and structured query language.

Innovation Solution

The use of zero-shot, context-based machine learning methods to automatically generate database queries and execute them, incorporating database structure information and validating queries to prevent malicious commands, thereby generating insights and plots without requiring technical expertise.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If traditional database query methods using structured query language are used, then data extraction capability is improved, but user accessibility deteriorates due to required technical expertise

Engineering Contradiction:
Improvedata extraction capabilityVSAvoiduser accessibility
Core Design Contradiction:
Measurement precisionVSEase of operation

Solution Approach 1:

The patent introduces a natural language processing intermediary layer that translates user-friendly natural language queries into structured database queries. This mediator system includes language understanding modules, query generation components, and database interaction layers that bridge the gap between casual user input and precise data extraction, eliminating the need for users to learn SQL while maintaining high data extraction capability

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces the mechanical syntax-based query system (SQL) with an intelligent language processing system. Instead of requiring users to follow strict grammatical rules and syntax structures, the system uses natural language understanding, semantic analysis, and automated query generation to interpret user intent and execute database operations, substituting rigid mechanical interaction with flexible intelligent processing

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Ease of operation

If automated query generation is implemented, then ease of use is improved, but system complexity increases due to machine learning integration

Engineering Contradiction:
Improveease of useVSAvoidsystem complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent segments the automated query generation system into distinct functional modules: natural language processing module, semantic analysis module, query template selection module, parameter extraction module, and query execution module. Each module handles a specific aspect of the translation process, making the overall complex system manageable through clear separation of concerns and specialized processing at each stage

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent employs multiple intermediary layers including language understanding intermediaries that convert natural language to structured representations, query generation intermediaries that map structured representations to query templates, and validation intermediaries that ensure query correctness. These intermediary components act as buffers that manage complexity while maintaining simplicity at the user interface

Inventive Principle:
Principle #24Intermediary (Mediator)

3Ease of operation

If natural language processing is used for query generation, then technical expertise requirement is reduced, but query accuracy may deteriorate

Engineering Contradiction:
Improvetechnical expertise requirementVSAvoidquery accuracy
Core Design Contradiction:
Ease of operationVSMeasurement precision

Solution Approach 1:

The patent implements feedback mechanisms where the system analyzes generated queries against the original natural language input, validates query semantics, and iteratively refines the translation. User feedback on query results is also incorporated to improve future translations, creating a continuous learning loop that enhances query accuracy while maintaining natural language accessibility

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent performs preliminary actions including natural language disambiguation, entity recognition, and intent classification before query generation. By pre-processing and structuring the natural language input, identifying key entities and relationships, and determining the intended operation type in advance, the system lays the groundwork for accurate query generation without requiring technical expertise from users

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20250225127A1System and method for artificial intelligence based generation of database queries
Publication Date: 2025.07.10 NICE LTD
  • US20250225127A1 patent drawing
  • US20250225127A1 patent drawing
  • US20250225127A1 patent drawing

AI summary

A system and method for automatic generation of database queries using zero-shot, context-based machine learning may output and/or execute database queries and/or analytics insights or plots based on text prompts, and may include or involve: wrapping a text prompt to include database structure information; generating, by a large language model (LLM), a query based on the wrapped prompt, where the query may include one or more database operations; and extracting data or information items from a database based on the query. Some embodiments may include additional prompt or query processing operations such as, e.g., wrapping queries to include corresponding database operations, validating that queries do not include malicious or undesirable commands, and automatically performing appropriate computer actions based on generated queries. Some embodiments of the invention may relate to databases and text prompts describing user actions input to a computer and collected by a desktop data collection software.