# US 2026/0099488 A1 · Natural language query processing using large language model-based asset analysis

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0099488 A1
- Document ID: US20260099488A1
- Status: Published application
- Kind: A1
- Application number: 18/905,787
- Filed: 2024-10-03
- Published: 2026-04-09
- Earliest claimed: 2024-10-03
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Joshua Abraham; Kun Lu; Yuhan Shao; Zhibo Zhang; Hosam Aly
- Web page: https://patentgrep.com/patent/US20260099488A1

## CPC

- G06F 16/24522: {Translation of natural language queries to structured queries}
- G06F 16/2423: {Interactive query statement specification based on a database schema}
- G06F 16/243: {Natural language query formulation}
- G06F 40/247: Thesauruses; Synonyms
- G06F 40/279: Recognition of textual entities
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A present invention embodiment processes user queries. Using a large language model (LLM), a first Structured Query Language (SQL) statement is generated based on a user query provided by a user. A plurality of entities are extracted, based on the first SQL statement, including columns, filter columns, and categorical filters. A semantic search is performed on an index of a plurality of databases using the extracted entities to determine a confidence score for each database of the plurality of databases. A database is selected based on the confidence score and a schema of the selected database is extracted. A second SQL statement is generated by the LLM based on the user query and the schema. The second SQL statement is executed on the selected database to generate query results that are presented to the user.

## Claims

### Claim 1

A computer-implemented method comprising:
generating, using a large language model (LLM), a first Structured Query Language (SQL) statement based on a user query provided by a user;
extracting a plurality of entities, based on the first SQL statement, comprising one or more columns, filter columns, and categorical filters;
performing a semantic search on an index of a plurality of databases using the one or more columns, filter columns, and categorical filters to determine a confidence score for each database of the plurality of databases, wherein the confidence score indicates a match for each database with respect to the one or more extracted columns, filter columns, and categorical filters;
selecting a database based on the confidence score and extracting a schema of the selected database;
generating, using the LLM, a second SQL statement based on the user query and the schema;
executing the second SQL statement on the selected database to generate query results; and
presenting the query results to the user.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising validating the selected database using the LLM by providing, to the LLM, a prompt that includes the user query, the schema of the selected database, and a request to determine that the selected database includes data that supports the user query.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein the confidence score is determined by evaluating column names of each database with respect to the one or more extracted columns or filter columns.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein the confidence score is determined by generating synonyms of the one or more extracted columns or filter columns, and evaluating column names of each database with respect to the generated synonyms.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the confidence score is determined by evaluating the one or more extracted categorical filters with respect to categorical filters of each database.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein a prompt that is provided to the LLM to generate the first SQL statement or the second SQL statement includes one or more examples of desired output.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein a prompt that is provided to the LLM to generate the first SQL statement or the second SQL statement includes a request for the first SQL statement or the second SQL statement to comply with a particular SQL dialect.

### Claim 8

A computer system comprising:
one or more memories; and
at least one processor coupled to the one or more memories, wherein the at least one processor is configured to:
generate, using a large language model (LLM), a first Structured Query Language (SQL) statement based on a user query provided by a user;
extract a plurality of entities, based on the first SQL statement, comprising one or more columns, filter columns, and categorical filters;
perform a semantic search on an index of a plurality of databases using the one or more columns, filter columns, and categorical filters to determine a confidence score for each database of the plurality of databases, wherein the confidence score indicates a match for each database with respect to the one or more extracted columns, filter columns, and categorical filters;
select a database based on the confidence score and extract a schema of the selected database;
generate, using the LLM, a second SQL statement based on the user query and the schema;
execute the second SQL statement on the selected database to generate query results; and
present the query results to the user.

### Claim 9 (depends on 8)

The computer system of claim 8, wherein the at least one processor is further configured to validate the selected database using the LLM by providing, to the LLM, a prompt that includes the user query, the schema of the selected database, and a request to determine that the selected database includes data that supports the user query.

### Claim 10 (depends on 8)

The computer system of claim 8, wherein the confidence score is determined by evaluating column names of each database with respect to the one or more extracted columns or filter columns.

### Claim 11 (depends on 8)

The computer system of claim 8, wherein the confidence score is determined by generating synonyms of the one or more extracted columns or filter columns, and evaluating column names of each database with respect to the generated synonyms.

### Claim 12 (depends on 8)

The computer system of claim 8, wherein the confidence score is determined by evaluating the one or more extracted categorical filters with respect to categorical filters of each database.

### Claim 13 (depends on 8)

The computer system of claim 8, wherein a prompt that is provided to the LLM to generate the first SQL statement or the second SQL statement includes one or more examples of desired output.

### Claim 14 (depends on 8)

The computer system of claim 8, wherein a prompt that is provided to the LLM to generate the first SQL statement or the second SQL statement includes a request for the first SQL statement or the second SQL statement to comply with a particular SQL dialect.

### Claim 15

A computer program product, the computer program product comprising one or more computer readable storage media having program instructions collectively stored on the one or more computer readable storage media, the program instructions executable by at least one processor to cause the at least one processor to:
generate, using a large language model (LLM), a first Structured Query Language (SQL) statement based on a user query provided by a user;
extract a plurality of entities, based on the first SQL statement, comprising one or more columns, filter columns, and categorical filters;
perform a semantic search on an index of a plurality of databases using the one or more columns, filter columns, and categorical filters to determine a confidence score for each database of the plurality of databases, wherein the confidence score indicates a match for each database with respect to the one or more extracted columns, filter columns, and categorical filters;
select a database based on the confidence score and extract a schema of the selected database;
generate, using the LLM, a second SQL statement based on the user query and the schema;
execute the second SQL statement on the selected database to generate query results; and
present the query results to the user.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein the program instructions further cause the at least one processor to validate the selected database using the LLM by providing, to the LLM, a prompt that includes the user query, the schema of the selected database, and a request to determine that the selected database includes data that supports the user query.

### Claim 17 (depends on 15)

The computer program product of claim 15, wherein the confidence score is determined by evaluating column names of each database with respect to the one or more extracted columns or filter columns.

### Claim 18 (depends on 15)

The computer program product of claim 15, wherein the confidence score is determined by generating synonyms of the one or more extracted columns or filter columns, and evaluating column names of each database with respect to the generated synonyms.

### Claim 19 (depends on 15)

The computer program product of claim 15, wherein the confidence score is determined by evaluating the one or more extracted categorical filters with respect to categorical filters of each database.

### Claim 20 (depends on 15)

The computer program product of claim 15, wherein a prompt that is provided to the LLM to generate the first SQL statement or the second SQL statement includes one or more examples of desired output.
