# US 2025/0094455 A1 · Contextual query rewriting

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

- Number: US 2025/0094455 A1
- Document ID: US20250094455A1
- Status: Published application
- Kind: A1
- Application number: 18/885,347
- Filed: 2024-09-13
- Published: 2025-03-20
- Earliest claimed: 2023-09-15
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Umanga Bista; Ying Xu; Aashna Devang Kanuga; Xin Xu; Vishal Vishnoi; Charles Woodrow Dickstein
- Web page: https://patentgrep.com/patent/US20250094455A1

## CPC

- G06F 16/3329: Natural language query formulation
- G06F 16/3344: {using natural language analysis}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques are disclosed herein for contextual query rewriting. The techniques include inputting a first user utterance and a conversation history to a first language model. The first language model identifies an ambiguity in the first user utterance and one or more terms in the conversation history to resolve the ambiguity, modifies the first user utterance to include the one or more terms identified to resolve the ambiguity to generate a modified utterance, and outputs the modified utterance. The computing system provides the modified utterance as input to a second language model. The second language model performs a natural language processing task based on the input modified utterance and outputs a result. The computing system outputs a response to the first user utterance based on the result.

## Claims

### Claim 1

A computer-implemented method comprising:
inputting, by a computing system, a first user utterance and a conversation history to a first language model,
wherein the first language model identifies an ambiguity in the first user utterance and one or more terms in the conversation history to resolve the ambiguity, modifies the first user utterance to include the one or more terms identified to resolve the ambiguity to generate a modified utterance, and outputs the modified utterance;
providing, by the computing system, the modified utterance as input to a second language model, wherein the second language model performs a natural language processing task based on the input modified utterance and outputs a result; and
outputting, by the computing system, a response to the first user utterance based on the result.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising:
providing, by the computing system to the first language model, a second user utterance, wherein the first language model determines that no ambiguity meriting resolution exists in the second user utterance and outputs an indication thereof; and
based on the indication, passing, by the computing system, the second user utterance to the second language model without modification.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein the modified utterance comprises a query, and wherein the result is an answer to the query.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein the ambiguity in the first user utterance comprises an anaphora.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the ambiguity in the first user utterance comprises one or more missing words.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein the ambiguity in the first user utterance comprises a reference to an intent from the conversation history.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein the ambiguity in the first user utterance comprises a correction to one or more words in the conversation history.

### Claim 8

A system comprising:
one or more processors; and
one or more computer-readable media storing instructions which, when executed by the one or more processors, cause the system to perform the following operations:
inputting a first user utterance and a conversation history to a first language model,
wherein the first language model identifies an ambiguity in the first user utterance and one or more terms in the conversation history to resolve the ambiguity, modifies the first user utterance to include the one or more terms identified to resolve the ambiguity to generate a modified utterance, and outputs the modified utterance;
providing the modified utterance as input to a second language model, wherein the second language model performs a natural language processing task based on the input modified utterance and outputs a result; and
outputting a response to the first user utterance based on the result.

### Claim 9 (depends on 8)

The system of claim 8, the operations further comprising:
providing, to the first language model, a second user utterance,
wherein the first language model determines that no ambiguity meriting resolution exists in the second user utterance and outputs an indication thereof; and
based on the indication, passing the second user utterance to the second language model without modification.

### Claim 10 (depends on 8)

The system of claim 8, wherein the modified utterance comprises a query, and
wherein the result is an answer to the query.

### Claim 11 (depends on 8)

The system of claim 8, wherein the ambiguity in the first user utterance comprises an anaphora.

### Claim 12 (depends on 8)

The system of claim 8, wherein the ambiguity in the first user utterance comprises one or more missing words.

### Claim 13 (depends on 8)

The system of claim 8, wherein the ambiguity in the first user utterance comprises a reference to an intent from the conversation history.

### Claim 14 (depends on 8)

The system of claim 8, wherein the ambiguity in the first user utterance comprises a correction to one or more words in the conversation history.

### Claim 15

One or more non-transitory computer-readable media storing instructions which, when executed by one or more processors, cause a system to perform the following operations:
inputting a first user utterance and a conversation history to a first language model,
wherein the first language model identifies an ambiguity in the first user utterance and one or more terms in the conversation history to resolve the ambiguity, modifies the first user utterance to include the one or more terms identified to resolve the ambiguity to generate a modified utterance, and outputs the modified utterance;
providing the modified utterance as input to a second language model, wherein the second language model performs a natural language processing task based on the input modified utterance and outputs a result; and
outputting a response to the first user utterance based on the result.

### Claim 16 (depends on 15)

The one or more non-transitory computer-readable media of claim 15, the operations further comprising:
providing, to the first language model, a second user utterance,
wherein the first language model determines that no ambiguity meriting resolution exists in the second user utterance and outputs an indication thereof; and
based on the indication, passing the second user utterance to the second language model without modification.

### Claim 17 (depends on 15)

The one or more non-transitory computer-readable media of claim 15, wherein the modified utterance comprises a query, and wherein the result is an answer to the query.

### Claim 18 (depends on 15)

The one or more non-transitory computer-readable media of claim 15, wherein the ambiguity in the first user utterance comprises an anaphora.

### Claim 19 (depends on 15)

The one or more non-transitory computer-readable media of claim 15, wherein the ambiguity in the first user utterance comprises one or more missing words.

### Claim 20 (depends on 15)

The one or more non-transitory computer-readable media of claim 15, wherein the ambiguity in the first user utterance comprises a reference to an intent from the conversation history.
