# US 2026/0087050 A1 · Systems and methods for two-step retrieval augmented generation

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

- Number: US 2026/0087050 A1
- Document ID: US20260087050A1
- Status: Published application
- Kind: A1
- Application number: 18/895,287
- Filed: 2024-09-24
- Published: 2026-03-26
- Earliest claimed: 2024-09-24
- Assignees: U.S. Bancorp, National Association
- Applicants: U.S. Bancorp, National Association
- Inventors: Giacomo Domeniconi; Kai-min Kevin Chang; Samuel Assefa
- Web page: https://patentgrep.com/patent/US20260087050A1

## CPC

- G06F 16/3344: {using natural language analysis}
- G06F 16/3347: {using vector based model}
- G06F 16/383: using metadata automatically derived from the content
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method includes receiving, by one or more processors, a natural language query, executing, by the one or more processors, a first large language model (LLM) using as input the natural language query to generate a preliminary response to the natural language query, executing, by the one or more processors, a machine learning model using as input the preliminary response to generate a preliminary response embedding, querying, by the one or more processors, a vector database using the preliminary response embedding to retrieve contextual data for the natural language query, and executing, by the one or more processors, a second LLM using as input the natural language query and the contextual data to generate a response to the natural language query.

## Claims

### Claim 1

A method comprising:
receiving, by one or more processors, a natural language query;
executing, by the one or more processors, a first large language model (LLM) using as input the natural language query to generate a preliminary response to the natural language query;
executing, by the one or more processors, a machine learning model using as input the preliminary response to generate a preliminary response embedding;
querying, by the one or more processors, a vector database using the preliminary response embedding to retrieve contextual data for the natural language query; and
executing, by the one or more processors, a second LLM using as input the natural language query and the contextual data to generate a response to the natural language query.

### Claim 2 (depends on 1)

The method of claim 1, further comprising executing, by the one or more processors, the machine learning model using as input domain data to generate the vector database.

### Claim 3 (depends on 1)

The method of claim 1, further comprising fine-tuning, by the one or more processors, the first LLM using domain data used to generate the vector database.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
executing, by the one or more processors, an evaluation model using as input the response to determine an accuracy score for the response; and
based on the accuracy score being below a predetermined threshold, performing one or more of:
transmitting, by the one or more processors, the response to a user device;
executing, by the one or more processors, the first LLM using as input the natural language query and the response; or
executing, by the one or more processors, the machine learning model using as input the response to generate a response embedding.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
executing, by the one or more processors, the first LLM using as input the natural language query and the response to generate a second preliminary response;
executing, by the one or more processors, the machine learning model using as input the second preliminary response to generate a second preliminary response embedding;
querying, by the one or more processors, the vector database using the second preliminary response embedding to retrieve second contextual data; and
executing, by the one or more processors, the second LLM using as input the natural language query and the second contextual data.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
executing, by the one or more processors, the machine learning model using as input the response to generate a response embedding;
querying, by the one or more processors, the vector database using the response embedding to retrieve second contextual data; and
executing, by the one or more processors, the second LLM using as input the natural language query and the second contextual data.

### Claim 7 (depends on 1)

The method of claim 1, wherein the first LLM and the second LLM are the same LLM.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
executing, by the one or more processors, the machine learning model using as input the natural language query to generate a natural language query embedding;
and querying, by the one or more processors, the vector database using the natural language query embedding to retrieve additional contextual data for the natural language query, wherein executing, by the one or more processors, the second LLM includes executing, by the one or more processors, the second LLM using as input the contextual data and the additional contextual data.

### Claim 9 (depends on 1)

The method of claim 1, wherein the response to the natural language query includes a relevance score for the contextual data, and wherein the method further comprises:
determining, by the one or more processors, whether the relevance score is above a predetermined threshold; and
displaying, by the one or more processors, via a user interface, the response based on the relevance score being above the predetermined threshold.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
receiving, by the one or more processors, a plurality of preliminary responses;
executing, by the one or more processors, the machine learning model using as input the plurality of preliminary responses to generate a plurality of preliminary response embeddings;
querying, by the one or more processors, the vector database using the plurality of preliminary response embeddings to retrieve additional contextual data for the natural language query; and
executing, by the one or more processors, a second LLM using as input the natural language query and the additional contextual data to generate a plurality of responses to the natural language query.

### Claim 11

A system comprising:
one or more processors; and
one or more non-transitory, computer-readable media including instructions which, when executed by the one or more processors, cause the one or more processors to:
receive a natural language query;
execute a first large language model (LLM) using as input the natural language query to generate a preliminary response to the natural language query;
execute a machine learning model using as input the preliminary response to generate a preliminary response embedding;
query a vector database using the preliminary response embedding to retrieve contextual data for the natural language query; and
execute a second LLM using as input the natural language query and the contextual data to generate a response to the natural language query.

### Claim 12 (depends on 11)

The system of claim 11, wherein the instructions cause the one or more processors to execute the machine learning model using as input domain data to generate the vector database.

### Claim 13 (depends on 11)

The system of claim 11, wherein the instructions cause the one or more processors to fine tune the first LLM using domain data used to generate the vector database.

### Claim 14 (depends on 11)

The system of claim 11, wherein the instructions cause the one or more processors to:
execute an evaluation model using as input the response to determine an accuracy score for the response; and
based on the accuracy score being below a predetermined threshold, perform one or more of:
transmit the response to a user device;
execute the first LLM using as input the natural language query and the response; or
execute the machine learning model using as input the response to generate a response embedding.

### Claim 15 (depends on 11)

The system of claim 11, wherein the instructions cause the one or more processors to:
execute the first LLM using as input the natural language query and the response to generate a second preliminary response;
execute the machine learning model using as input the second preliminary response to generate a second preliminary response embedding;
query the vector database using the second preliminary response embedding to retrieve second contextual data; and
execute the second LLM using as input the natural language query and the second contextual data.

### Claim 16 (depends on 11)

The system of claim 11, wherein the instructions cause the one or more processors to:
execute the machine learning model using as input the response to generate a response embedding;
query the vector database using the response embedding to retrieve second contextual data; and
execute the second LLM using as input the natural language query and the second contextual data.

### Claim 17 (depends on 11)

The system of claim 11, wherein the first LLM and the second LLM are the same LLM.

### Claim 18 (depends on 11)

The system of claim 11, wherein the instructions cause the one or more processors to:
execute the machine learning model using as input the natural language query to generate a natural language query embedding; and
query the vector database using the natural language query embedding to retrieve additional contextual data for the natural language query, wherein executing, by the one or more processors, the second LLM includes executing, by the one or more processors, the second LLM using as input the contextual data and the additional contextual data.

### Claim 19

One or more non-transitory, computer-readable media including instructions which, when executed by one or more processors, cause the one or more processors to:
receive a natural language query;
execute a first large language model (LLM) using as input the natural language query to generate a preliminary response to the natural language query;
execute a machine learning model using as input the preliminary response to generate a preliminary response embedding;
query a vector database using the preliminary response embedding to retrieve contextual data for the natural language query; and
execute a second LLM using as input the natural language query and the contextual data to generate a response to the natural language query.

### Claim 20 (depends on 19)

The non-transitory, computer-readable media of claim 19, wherein the instructions further cause the one or more processors to:
execute an evaluation model using as input the response to determine an accuracy score for the response; and
based on the accuracy score being below a predetermined threshold, perform one or more of:
transmit the response to a user device;
execute the first LLM using as input the natural language query and the response; or
execute the machine learning model using as input the response to generate a response embedding.
