# US 2026/0064731 A1 · Smart RAG For Different Types Of Data

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

- Number: US 2026/0064731 A1
- Document ID: US20260064731A1
- Status: Published application
- Kind: A1
- Application number: 18/825,949
- Filed: 2024-09-05
- Published: 2026-03-05
- Earliest claimed: 2024-09-05
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Amir Hossein Rezaeian; Vijayalakshmi Krishnamurthy
- Web page: https://patentgrep.com/patent/US20260064731A1

## CPC

- G06F 16/3325: {Reformulation based on results of preceding query}
- G06F 16/24522: {Translation of natural language queries to structured queries}
- G06F 16/24532: {of parallel queries}
- G06F 16/3329: Natural language query formulation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In some embodiments, a system generates a first query to be executed on a first data repository and a second query to be executed on a second data repository based on an initial user query using a first LLM, executes the first query on the first data repository to generate a first set of results, executes the second query on the second data repository to generate a second set of results, merges the first and second sets of results using a second LLM to form a merged set of results, selects a subset of the merged set of results based on a comparison of the merged set of results to the initial user query, generates a prompt based on the initial user query and the subset of the merged set of results, and submits the prompt to a third LLM to generate a response to the initial user query.

## Claims

### Claim 1

A method performed by at least one device including a hardware processor, the method comprising:
accessing an initial user query;
generating a first query and a second query based on the initial user query using a first Large Language Model (LLM), the first query being configured to be executed on a first data repository of a first type of data repository, the second query being configured to be executed on a second data repository of a second type of data repository, and the second data repository being of a second type of data repository different from the first type of data repository;
executing the first query on the first data repository to generate a first set of results;
executing the second query on the second data repository to generate a second set of results;
merging the first set of results and the second set of results using a second LLM to form a merged set of results;
selecting a subset of the merged set of results based on a comparison of the merged set of results to the initial user query;
generating a prompt based on the initial user query and the subset of the merged set of results;
submitting the prompt to a third LLM to generate a response to the initial user query; and
presenting the response to the initial user query on the computing device of the user.

### Claim 2 (depends on 1)

The method of claim 1, wherein the initial user query comprises a natural language prompt submitted by the user via the computing device.

### Claim 3 (depends on 1)

The method of claim 1, wherein the first query being a first type of query, the second query being a second type of query different from the first type of query and the generating the first query and the second query comprises using the first LLM to select the first type of query and the second type of query based on the initial user query.

### Claim 4 (depends on 1)

The method of claim 1, wherein:
the first data repository stores unstructured data; and
the second data repository stores structured data.

### Claim 5 (depends on 4)

The method of claim 4, wherein:
the first data repository is a vector data store;
the generating the first query comprises executing an embedding operation to generate a first vector corresponding to text of the initial user query;
the second data repository is a Structured Query Language (SQL) database;
the generating the second query comprises converting the text of the initial user query into an SQL query;
the executing the first query on the first data repository comprises executing a vector search on the vector data store using the first vector; and
the executing the second query on the second data repository comprises executing the SQL query on the SQL database.

### Claim 6 (depends on 1)

The method of claim 1, wherein the executing of the first query and the executing of the second query are performed in parallel.

### Claim 7 (depends on 1)

The method of claim 1, wherein the merging of the first set of results and the second set of results comprises inputting the first set of results, the second set of results, and the initial user query into the second LLM.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
ingesting a document comprising semi-structured data;
extracting structured data from the semi-structured data of the document;
determining that the structured data does not satisfy a minimum threshold amount of data; and
responsive to the determination that the structured data does not satisfy the minimum threshold amount of data:
converting the structured data into unstructured data;
executing an embedding operation to generate a vector corresponding to the unstructured data; and
storing the vector corresponding to the unstructured data in a vector data store of the first data repository.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
ingesting a document comprising semi-structured data;
extracting structured data from the semi-structured data of the document;
determining that the structured data satisfies a minimum threshold amount of data; and
responsive to the determination that the structured data satisfies the minimum threshold amount of data, storing the structured data in an SQL database of the second data repository.

### Claim 10

One or more non-transitory computer readable media comprising instructions which, when executed by one or more hardware processors, cause performance of operations comprising:
accessing an initial user query;
generating a first query and a second query based on the initial user query using a first Large Language Model (LLM), the first query being configured to be executed on a first data repository of a first type of data repository, the second query being configured to be executed on a second data repository of a second type of data repository, and the second data repository being of a second type of data repository different from the first type of data repository;
executing the first query on the first data repository to generate a first set of results;
executing the second query on the second data repository to generate a second set of results;
merging the first set of results and the second set of results using a second LLM to form a merged set of results;
selecting a subset of the merged set of results based on a comparison of the merged set of results to the initial user query;
generating a prompt based on the initial user query and the subset of the merged set of results;
submitting the prompt to a third LLM to generate a response to the initial user query; and
presenting the response to the initial user query on the computing device of the user.

### Claim 11 (depends on 10)

The media of claim 10, wherein the initial user query comprises a natural language prompt submitted by the user via the computing device.

### Claim 12 (depends on 10)

The media of claim 10, wherein the first query being a first type of query, the second query being a second type of query different from the first type of query and the generating the first query and the second query comprises using the first LLM to select the first type of query and the second type of query based on the initial user query.

### Claim 13 (depends on 10)

The media of claim 10, wherein:
the first data repository stores unstructured data; and
the second data repository stores structured data.

### Claim 14 (depends on 13)

The media of claim 13, wherein:
the first data repository is a vector data store;
the generating the first query comprises executing an embedding operation to generate a first vector corresponding to text of the initial user query;
the second data repository is a Structured Query Language (SQL) database;
the generating the second query comprises converting the text of the initial user query into an SQL query;
the executing the first query on the first data repository comprises executing a vector search on the vector data store using the first vector; and
the executing the second query on the second data repository comprises executing the SQL query on the SQL database.

### Claim 15 (depends on 10)

The media of claim 10, wherein the executing of the first query and the executing of the second query are performed in parallel.

### Claim 16 (depends on 10)

The media of claim 10, wherein the merging of the first set of results and the second set of results comprises inputting the first set of results, the second set of results, and the initial user query into the second LLM.

### Claim 17 (depends on 10)

The media of claim 10, wherein the operations further comprise:
ingesting a document comprising semi-structured data;
extracting structured data from the semi-structured data of the document;
determining that the structured data does not satisfy a minimum threshold amount of data; and
responsive to the determination that the structured data does not satisfy the minimum threshold amount of data:
converting the structured data into unstructured data;
executing an embedding operation to generate a vector corresponding to the unstructured data; and
storing the vector corresponding to the unstructured data in a vector data store of the first data repository.

### Claim 18 (depends on 10)

The media of claim 10, wherein the operations further comprise:
ingesting a document comprising semi-structured data;
extracting structured data from the semi-structured data of the document;
determining that the structured data satisfies a minimum threshold amount of data; and
responsive to the determination that the structured data satisfies the minimum threshold amount of data, storing the structured data in an SQL database of the second data repository.

### Claim 19

A system comprising:
at least one device including a hardware processor;
the system being configured to perform operations comprising:
accessing an initial user query;
generating a first query and a second query based on the initial user query using a first Large Language Model (LLM), the first query being configured to be executed on a first data repository of a first type of data repository, the second query being configured to be executed on a second data repository of a second type of data repository, and the second data repository being of a second type of data repository different from the first type of data repository;
executing the first query on the first data repository to generate a first set of results;
executing the second query on the second data repository to generate a second set of results;
merging the first set of results and the second set of results using a second LLM to form a merged set of results;
selecting a subset of the merged set of results based on a comparison of the merged set of results to the initial user query;
generating a prompt based on the initial user query and the subset of the merged set of results;
submitting the prompt to a third LLM to generate a response to the initial user query; and
presenting the response to the initial user query on the computing device of the user.

### Claim 20 (depends on 19)

The system of claim 19, wherein the initial user query comprises a natural language prompt submitted by the user via the computing device.
