# US 2025/0156458 A1 · Efficient rag model for medical applications

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

- Number: US 2025/0156458 A1
- Document ID: US20250156458A1
- Status: Published application
- Kind: A1
- Application number: 18/946,726
- Filed: 2024-11-13
- Published: 2025-05-15
- Earliest claimed: 2023-11-14
- Assignees: Datum Point Labs Inc.
- Applicants: Datum Point Labs Inc.
- Inventors: DAVID LEE; HANSEOK KO; BONHWA KU; NOJIN PARK
- Web page: https://patentgrep.com/patent/US20250156458A1

## CPC

- G06F 16/334: Query execution (filtering based on additional data G06F16/335)
- G06F 16/338: Presentation of query results
- G06F 16/355: Creation or modification of classes or clusters
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments described herein provide systems and methods for retrieval augmented generation. Embodiments herein include a pipeline for database construction from unlabeled data. Embodiments also include smart chunking techniques for more efficient retrieval. Embodiments also include quantization of a sentence embedding model used in the retrieval process, resulting in a faster more lightweight overall system. Use of a lightweight LLM allows for local LLM inference, increasing data privacy.

## Claims

### Claim 1

A method of retrieval augmented generation, comprising:
receiving, via a data interface, a query;
retrieving a plurality of text chunks from a database based on a comparison of contents of the database with an embedding of the query;
inputting a prompt to a neural network based language model, the prompt including the plurality of text chunks and the query; and
outputting, via the neural network based language model, a text output based on the prompt.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
generating the plurality of text chunks from an input text based on a similarity between consecutive sentences of the input text.

### Claim 3 (depends on 2)

The method of claim 2, wherein the generating the plurality of text chunks further comprises:
generating, via a neural network based model, respective embeddings of the consecutive sentences of the input text,
wherein the similarity is based on a comparison of the respective embeddings.

### Claim 4 (depends on 3)

The method of claim 3, wherein the similarity is further based on a weighting of the consecutive sentences according to a distance of the sentences from each other in the input text.

### Claim 5 (depends on 4)

The method of claim 4, wherein the generating the plurality of text chunks further comprises grouping consecutive sentences together when the similarity is above a predetermined threshold.

### Claim 6 (depends on 5)

The method of claim 5, wherein the generating the plurality of text chunks further comprises further grouping the consecutive sentences into smaller groups based on the grouping being over a threshold size.

### Claim 7 (depends on 1)

The method of claim 1, wherein the retrieving the plurality of text chunks includes retrieving a predetermined number of text chunks.

### Claim 8

A system for retrieval augmented generation, comprising:
a memory storing processor executable instructions; and
one or more processors that read and execute the processor executable instructions from the memory to perform operations comprising:
receiving, via a data interface, a query;
retrieving a plurality of text chunks from a database based on a comparison of contents of the database with an embedding of the query;
inputting a prompt to a neural network based language model, the prompt including the plurality of text chunks and the query; and
outputting, via the neural network based language model, a text output based on the prompt.

### Claim 9 (depends on 8)

The system of claim 8, further comprising:
generating the plurality of text chunks from an input text based on a similarity between consecutive sentences of the input text.

### Claim 10 (depends on 9)

The system of claim 9, wherein the generating the plurality of text chunks further comprises:
generating, via a neural network based model, respective embeddings of the consecutive sentences of the input text,
wherein the similarity is based on a comparison of the respective embeddings.

### Claim 11 (depends on 10)

The system of claim 10, wherein the similarity is further based on a weighting of the consecutive sentences according to a distance of the sentences from each other in the input text.

### Claim 12 (depends on 11)

The system of claim 11, wherein the generating the plurality of text chunks further comprises grouping consecutive sentences together when the similarity is above a predetermined threshold.

### Claim 13 (depends on 12)

The system of claim 12, wherein the generating the plurality of text chunks further comprises further grouping the consecutive sentences into smaller groups based on the grouping being over a threshold size.

### Claim 14 (depends on 8)

The system of claim 8, wherein the retrieving the plurality of text chunks includes retrieving a predetermined number of text chunks.

### Claim 15

A non-transitory machine-readable medium comprising a plurality of machine-executable instructions which, when executed by one or more processors, are adapted to cause the one or more processors to perform operations comprising:
receiving, via a data interface, a query;
retrieving a plurality of text chunks from a database based on a comparison of contents of the database with an embedding of the query;
inputting a prompt to a neural network based language model, the prompt including the plurality of text chunks and the query; and
outputting, via the neural network based language model, a text output based on the prompt.

### Claim 16 (depends on 15)

The non-transitory machine-readable medium of claim 15, further comprising:
generating the plurality of text chunks from an input text based on a similarity between consecutive sentences of the input text.

### Claim 17 (depends on 16)

The non-transitory machine-readable medium of claim 16, wherein the generating the plurality of text chunks further comprises:
generating, via a neural network based model, respective embeddings of the consecutive sentences of the input text,
wherein the similarity is based on a comparison of the respective embeddings.

### Claim 18 (depends on 17)

The non-transitory machine-readable medium of claim 17, wherein the similarity is further based on a weighting of the consecutive sentences according to a distance of the sentences from each other in the input text.

### Claim 19 (depends on 18)

The non-transitory machine-readable medium of claim 18, wherein the generating the plurality of text chunks further comprises grouping consecutive sentences together when the similarity is above a predetermined threshold.

### Claim 20 (depends on 19)

The non-transitory machine-readable medium of claim 19, wherein the generating the plurality of text chunks further comprises further grouping the consecutive sentences into smaller groups based on the grouping being over a threshold size.
