# US 2026/0064672 A1 · System and method for improving efficiency in natural language query processing utilizing language model

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

- Number: US 2026/0064672 A1
- Document ID: US20260064672A1
- Status: Published application
- Kind: A1
- Application number: 19/384,713
- Filed: 2025-11-10
- Published: 2026-03-05
- Earliest claimed: 2023-08-28
- Assignees: Wiz, Inc.
- Applicants: Wiz, Inc.
- Inventors: Daniel LAZAREV; Barak SHARONI; Bar MAGNEZI
- Web page: https://patentgrep.com/patent/US20260064672A1

## CPC

- G06F 16/243: {Natural language query formulation}
- G06F 16/212: {with details for data modelling support}
- G06F 16/2455: Query execution
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system and method for generating a database query based on a natural language query is presented. The method includes receiving an unstructured natural language query directed to a security database, wherein the security database includes a representation of a computing environment; selecting a group of database queries from a plurality of preexisting database queries based on a similarity to the unstructured natural language query; generating a context for processing by a language model, the context including the selected group of database queries, an identified technology, and a schema of the computing environment; processing a prompt and the generated context utilizing the language model to generate a second database query; and executing the second database query on the security database.

## Claims

### Claim 1

A method for generating a database query based on a natural language query, comprising:
receiving an unstructured natural language query directed to a security database, wherein the security database includes a representation of a computing environment;
selecting a database query from a plurality of preexisting database queries based on a similarity to the unstructured natural language query;
generating a context for processing by a language model, the context including the selected database query, an identified technology, and a schema of the computing environment;
processing a prompt and the generated context utilizing the language model to generate a second database query; and
executing the second database query on the security database.

### Claim 2 (depends on 1)

The method of claim 1, wherein selecting the database query further comprises:
vectorizing each of the plurality of preexisting database queries and the unstructured natural language query;
determining a similarity score based on a distance between a vector of a preexisting database query and a vector of the unstructured natural language query; and
selecting a preexisting database query based on a similarity score exceeding a predetermined threshold.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
re-ranking the selected preexisting database queries; and
generating the context based on the re-ranked preexisting database queries.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
generating the prompt for a large language model based on the unstructured natural language query and a first database query.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
determining a data schema, the data schema utilized to represent an entity of the computing environment; and
generating the prompt further based on the determined data schema.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
determining the data schema based on the unstructured natural language query.

### Claim 7 (depends on 4)

The method of claim 4, further comprising:
generating the prompt further based on a technology identifier, the technology identifier determined based on data extracted from the unstructured natural language query.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
parsing the received natural language query to a textual input including a plurality of text elements; and
matching a text element of the plurality of text elements to the schema.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
selecting the database query utilizing a first language model; and
processing the prompt utilizing a second language model.

### Claim 10

A non-transitory computer-readable medium storing a set of instructions for generating a database query based on a natural language query, the set of instructions comprising:
one or more instructions that, when executed by one or more processing circuitries of a device, cause the device to:
receive an unstructured natural language query directed to a security database, wherein the security database includes a representation of a computing environment;
select a database query from a plurality of preexisting database queries based on a similarity to the unstructured natural language query;
generate a context for processing by a language model, the context including the selected database query, an identified technology, and a schema of the computing environment;
process a prompt and the generated context utilizing the language model to generate a second database query; and
execute the second database query on the security database.

### Claim 11

A system for generating a database query based on a natural language query comprising:
a processing circuitry;
a memory, the memory containing instructions that, when executed by the processing circuitry, configure the system to:
receive an unstructured natural language query directed to a security database, wherein the security database includes a representation of a computing environment;
select a database query from a plurality of preexisting database queries based on a similarity to the unstructured natural language query;
generate a context for processing by a language model, the context including the selected database query, an identified technology, and a schema of the computing environment;
process a prompt and the generated context utilizing the language model to generate a second database query; and
execute the second database query on the security database.

### Claim 12 (depends on 11)

The system of claim 11, wherein the memory contains further instructions that, when executed by the processing circuitry for selecting the database query, further configure the system to:
vectorize each of the plurality of preexisting database queries and the unstructured natural language query;
determine a similarity score based on a distance between a vector of a preexisting database query and a vector of the unstructured natural language query; and
select a preexisting database query based on a similarity score exceeding a predetermined threshold.

### Claim 13 (depends on 12)

The system of claim 12, wherein the memory contains further instructions which when executed by the processing circuitry further configure the system to:
re-rank the selected preexisting database queries; and
generate the context based on the re-ranked preexisting database queries.

### Claim 14 (depends on 11)

The system of claim 11, wherein the memory contains further instructions which when executed by the processing circuitry further configure the system to:
generate the prompt for a large language model based on the unstructured natural language query and a first database query.

### Claim 15 (depends on 14)

The system of claim 14, wherein the memory contains further instructions which when executed by the processing circuitry further configure the system to:
determine a data schema, the data schema utilized to represent an entity of the computing environment; and
generate the prompt further based on the determined data schema.

### Claim 16 (depends on 15)

The system of claim 15, wherein the memory contains further instructions which when executed by the processing circuitry further configure the system to:
determine the data schema based on the unstructured natural language query.

### Claim 17 (depends on 14)

The system of claim 14, wherein the memory contains further instructions which when executed by the processing circuitry further configure the system to:
generate the prompt further based on a technology identifier, the technology identifier determined based on data extracted from the unstructured natural language query.

### Claim 18 (depends on 11)

The system of claim 11, wherein the memory contains further instructions which when executed by the processing circuitry further configure the system to:
parse the received natural language query to a textual input including a plurality of text elements; and
match a text element of the plurality of text elements to the schema.

### Claim 19 (depends on 11)

The system of claim 11, wherein the memory contains further instructions which when executed by the processing circuitry further configure the system to:
select the database query utilizing a first language model; and
process the prompt utilizing a second language model.
