# US 12,602,412 B2 · Method and system for optimizing use of retrieval augmented generation pipelines in generative artificial intelligence applications

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

- Number: US 12,602,412 B2
- Document ID: US12602412B2
- Status: Granted
- Kind: B2
- Application number: 19/306,379
- Filed: 2025-08-21
- Published: 2026-01-22
- Granted: 2026-04-14
- Earliest claimed: 2023-05-04
- Assignees: Vijay Madisetti
- Applicants: Vijay Madisetti
- Inventors: Vijay Madisetti; Arshdeep Bahga
- Web page: https://patentgrep.com/patent/US12602412B2

## CPC

- G06F 16/3329: Natural language query formulation
- G06F 12/0875: with dedicated cache, e.g. instruction or stack
- G06F 16/3344: {using natural language analysis}
- G06F 16/3347: {using vector based model}
- G06F 16/335: Filtering based on additional data, e.g. user or group profiles (filtering in web context G06F16/9535, G06F16/9536)
- G06F 16/383: using metadata automatically derived from the content
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 40/30: Semantic analysis
- G06F 2212/454: Vector or matrix data
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods of processing domain-specific content in a generative AI system including receiving a prompt, tokenizing the prompt, identifying an identified domain of the tokenized prompt identifying domain-specific functions within the identified domain, generating domain-specific sub-functions from the domain-specific functions according to a hierarchical mapping, generating H-Tokens, each encapsulating one of a domain-specific function or a domain-specific sub-function and relationships domain-specific functions and the domain-specific sub-functions, implementing the of H-Tokens, assembling a response using the implemented of H-Tokens, and transmitting the response to the user.

## Claims

### Claim 1

A method of processing domain-specific content in a generative artificial intelligence system, comprising:
receiving a prompt from a user;
generating a tokenized prompt by performing an initial tokenization of the prompt;
identifying an identified domain comprised by a plurality of supported domains that is associated with the tokenized prompt by analyzing the tokenized prompt;
identifying one or more domain-specific functions within the identified domain by performing a domain-specific analysis on the tokenized prompt;
generating a plurality of domain-specific sub-functions from the one or more domain-specific functions according to a hierarchical mapping of the identified domain;
generating a plurality of hierarchical tokens (H-Tokens), each H-Token of the plurality of H-Tokens being configured to encapsulate one of a domain-specific function of the one or more domain-specific functions or a domain-specific sub-function of the plurality of domain-specific sub-functions, and relationships between the one or more domain-specific functions and the plurality of domain-specific sub-functions;
implementing the plurality of H-Tokens, resulting in an implemented plurality of H-Tokens, by mapping each H-Token of the plurality of H-Tokens to each of a corresponding function, event, and implementation method within the identified domain;
assembling a response using the implemented plurality of H-Tokens; and
transmitting the response to the user.

### Claim 2 (depends on 1)

The method of claim 1, wherein implementing the plurality H-Tokens comprises:
identifying a plurality of functions as one of domain-specific tasks that lead to events or domain-specific processes that lead to events;
identifying a plurality of events as results of the plurality of functions; and
identifying a plurality of implementation methods to accomplish the plurality of functions.

### Claim 3 (depends on 2)

The method of claim 2 wherein each implementation method of the plurality of implementation methods is represented as an H-Token.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
assembling a context using the implemented plurality of H-Tokens;
selecting a processing path from one of:
expanding the plurality H-Tokens into regular tokens for processing; or
generating processed content by directly processing the plurality of H-Tokens without expansion;
generating a processed context by processing the context consistent with the processing path; and
integrating the processed context into the response.

### Claim 5 (depends on 1)

The method of claim 1, further comprising integrating the implemented plurality of H-Tokens with a retrieval-augmented generation (RAG) system by:
assembling an H-Token context comprising at least one of a location context, a duration context, and a preference context;
generating a processed context by processing the H-Token context through one of:
a token expansion path operable to expand the plurality of H-Tokens to regular tokens for traditional RAG processing; or
a direct H-Token processing path for H-Token-aware response generation; and
producing the response based on the processed context.

### Claim 6 (depends on 1)

The method of claim 1 wherein assembling the response using the implemented plurality of H-Tokens comprises:
assembling the implemented plurality of H-Tokens;
forming a preliminary response responsive to assembling the implemented plurality of H-Tokens; and
generating the response by performing a quality verification on the preliminary response.

### Claim 7

A system for processing domain-specific content in a generative artificial intelligence system, comprising:
a processor;
a network communication device operably coupled to the processor and configured to transmit and receive digital transmissions across a network to removed computerized devices; and
a non-transitory computer-readable storage medium having stored thereon software that, when executed by the processor, is configured to:
receive a prompt from a user;
generate a tokenized prompt by performing an initial tokenization of the prompt;
identify an identified domain comprised by a plurality of supported domains that is associated with the tokenized prompt by analyzing the tokenized prompt;
identify one or more domain-specific functions within the identified domain by performing a domain-specific analysis on the tokenized prompt;
generate a plurality of domain-specific sub-functions from the one or more domain-specific functions according to a hierarchical mapping of the identified domain;
generate a plurality of hierarchical tokens (H-Tokens), each H-Token of the plurality of H-Tokens being configured to encapsulate one of a domain-specific function of the one or more domain-specific functions or a domain-specific sub-function of the plurality of domain-specific sub-functions, and relationships between the one or more domain-specific functions and the plurality of domain-specific sub-functions;
implement the plurality of H-Tokens, resulting in an implemented plurality of H-Tokens, by mapping each H-Token of the plurality of H-Tokens to each of a corresponding function, event, and implementation method within the identified domain;
assemble a response using the implemented plurality of H-Tokens; and
transmit the response to the user.

### Claim 8 (depends on 7)

The system of claim 7, wherein the software, when executed by the processor, is operable to implement the plurality H-Tokens by:
identifying a plurality of functions as one of domain-specific tasks that lead to events or domain-specific processes that lead to events;
identifying a plurality of events as results of the plurality of functions; and
identifying a plurality of implementation methods to accomplish the plurality of functions.

### Claim 9 (depends on 8)

The system of claim 8 wherein each implementation method of the plurality of implementation methods is represented as an H-Token.

### Claim 10 (depends on 7)

The system of claim 7, wherein the software, when executed by the processor, is further operable to:
assemble a context using the implemented plurality of H-Tokens;
select a processing path from one of:
expand the plurality H-Tokens into regular tokens for processing; or
generate processed content by directly processing the plurality of H-Tokens without expansion;
generate a processed context by processing the context consistent with the processing path; and
integrate the processed context into the response.

### Claim 11 (depends on 7)

The system of claim 7 wherein the software, when executed by the processor, is further operable to integrate the implemented plurality of H-Tokens with a retrieval-augmented generation (RAG) system by:
assembling an H-Token context comprising at least one of a location context, a duration context, and a preference context;
generating a processed context by processing the H-Token context through one of:
a token expansion path operable to expand the plurality of H-Tokens to regular tokens for traditional RAG processing; or
a direct H-token processing path for H-Token-aware response generation; and
producing the response based on the processed context.

### Claim 12 (depends on 7)

The system of claim 7 wherein the software, when executed by the processor, is operable to assemble the response using the implemented plurality of H-Tokens by:
assembling the implemented plurality of H-Tokens;
forming a preliminary response responsive to assembling the implemented plurality of H-Tokens; and
generating the response by performing a quality verification on the preliminary response.

### Claim 13

A system for processing domain-specific content in a generative artificial intelligence system, comprising:
means for receiving a prompt from a user;
means for generating a tokenized prompt by performing an initial tokenization of the prompt;
means for identifying an identified domain comprised by a plurality of supported domains that is associated with the tokenized prompt by analyzing the tokenized prompt;
means for identifying one or more domain-specific functions within the identified domain by performing a domain-specific analysis on the tokenized prompt;
means for generating a plurality of domain-specific sub-functions from the one or more domain-specific functions according to a hierarchical mapping of the identified domain;
means for generating a plurality of hierarchical tokens (H-Tokens), each H-Token of the plurality of H-Tokens being configured to encapsulate one of a domain-specific function of the one or more domain-specific functions or a domain-specific sub-function of the plurality of domain-specific sub-functions, and relationships between the one or more domain-specific functions and the plurality of domain-specific sub-functions;
means for implementing the plurality of H-Tokens, resulting in an implemented plurality of H-Tokens, by mapping each H-Token of the plurality of H-Tokens to each of a corresponding function, event, and implementation method within the identified domain;
means for assembling a response using the implemented plurality of H-Tokens; and
means for transmitting the response to the user.

### Claim 14 (depends on 13)

The system of claim 13, wherein the means for implementing the plurality H-Tokens is operable to:
identify a plurality of functions as one of domain-specific tasks that lead to events or domain-specific processes that lead to events;
identify a plurality of events as results of the plurality of functions; and
identify a plurality of implementation methods to accomplish the plurality of functions.

### Claim 15 (depends on 14)

The system of claim 14 wherein each implementation method of the plurality of implementation methods is represented as an H-Token.

### Claim 16 (depends on 13)

The system of claim 13, further comprising:
means for assembling a context using the implemented plurality of H-Tokens;
means for selecting a processing path from one of:
expanding the plurality H-Tokens into regular tokens for processing; or
generating processed content by directly processing the plurality of H-Tokens without expansion;
means for generating a processed context by processing the context consistent with the processing path; and
means for integrating the processed context into the response.

### Claim 17 (depends on 13)

The system of claim 13, further comprising means for integrating the implemented plurality of H-Tokens with a retrieval-augmented generation (RAG) system by:
assembling an H-Token context comprising at least one of a location context, a duration context, and a preference context;
generating a processed context by processing the H-Token context through one of:
a token expansion path operable to expand the plurality of H-Tokens to regular tokens for traditional RAG processing; or
a direct H-token processing path for H-Token-aware response generation; and
producing the response based on the processed context.

### Claim 18 (depends on 13)

The system of claim 13 wherein the means for assembling the response using the implemented plurality of H-Tokens is operable to:
assemble the implemented plurality of H-Tokens;
form a preliminary response responsive to assembling the implemented plurality of H-Tokens; and
generate the response by performing a quality verification on the preliminary response.
