# US 12,223,080 B1 · Row level security in natural language question answering

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

- Number: US 12,223,080 B1
- Document ID: US12223080B1
- Status: Granted
- Kind: B1
- Application number: 18/070,086
- Filed: 2022-11-28
- Granted: 2025-02-11
- Earliest claimed: 2022-11-28
- Assignees: Amazon Technologies, Inc.
- Applicants: Amazon Technologies, Inc.
- Inventors: Amjad Al-Rikabi; Stephen Michael Ash; William Michael Siler; Rajkumar Haridoss; Rajesh Patel; Kushal Yelamali
- Web page: https://patentgrep.com/patent/US12223080B1

## CPC

- G06F 21/6227: {where protection concerns the structure of data, e.g. records, types, queries}
- G06F 16/243: {Natural language query formulation}
- G06F 16/2455: Query execution
- G06F 16/24564: {Applying rules; Deductive queries}
- G06F 16/13: File access structures, e.g. distributed indices (arrangements of input from, or output to, record carriers G06F3/06)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

This disclosure describes a natural language question (NLQ) query service within a service provider network that provides row level security (RLS) for autocomplete during entry of NLQs and fuzzy matching in NLQ answering. The rules take the form of per-user predicates such as Tim can only see rows with region=US. In configurations a complex extraction and preprocessing pipeline to extract distinct combinations of values against RLS predicate “rule keys” is used. Those distinct values are indexed along with grouped rule keys to enable pushing down predicates at auto-complete time. This enables pushing part of RLS rule handling to ingestion time of a dataset rather than handling all RLS rule handling at query time, enabling meeting of latency goals. In configurations, a single logical document of unique cell values is split into multiple documents with a subset of rule keys to handle scalability limits.

## Claims

### Claim 1

A computer-implemented method comprising:
providing a dataset consisting of rows and columns to define a plurality of cells, where each cell has a cell value, which thereby results in a plurality of cell values for the plurality of cells:
extracting, from the dataset, distinct cell values with respect to a first column value of a first column of the columns:
with respect to a second column value of a second column of the columns and a third column value of a third column of the columns, grouping the distinct cell values into groups:
transforming, using a distributed analysis platform, the groups into corresponding rule keys:
storing the rule keys in one or more documents of a database:
receiving, from a user, a natural language question (NLQ) requesting information with respect to the dataset:
determining a classification for the user with respect to the groups:
based on the classification, searching the one or more documents for applicable rule keys associated with the NLQ; and
based on the applicable rule keys, disregarding results that are responsive to the NLQ, wherein the results are from the rows of the dataset.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein:
receiving the NLQ comprises:
receiving a partial NLQ; and
auto-completing the NLQ within a search user interface displayed on a client device on behalf of the user; and
the computer-implemented method further comprises:
prior to auto-completing the NLQ on behalf of the user:
determining the classification for the user;
based on the classification, searching the one or more documents for the applicable rule keys; and
based on the applicable rule keys, filtering possibilities for the auto-completing of the NLQ on behalf of the user.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, further comprising:
creating a group of the groups, wherein the second column value within the group is null, wherein the group has access to all of the rows of the dataset with respect to the second column.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, further comprising:
creating an admin group of the groups, wherein the admin group has access to all of the rows of the dataset.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the extracting, grouping, transforming, and storing occur upon receipt of the dataset and prior to receipt of any NLQs from the user.

### Claim 6

A computer-implemented method comprising:
extracting cell values with respect to a first column value in a dataset;
with respect to a second column value and a third column value, defining rule keys based at least in part on the cell values;
storing the rule keys in one or more documents of a database;
receiving, from a user, a natural language question (NLQ);
determining a classification for the user;
based at least in part on the classification, searching the one or more documents for applicable rule keys; and
based at least in part on the applicable rule keys, filtering results to the NLQ, wherein the results are from rows of the dataset.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, wherein:
receiving the NLQ comprises:
receiving a partial NLQ; and
auto-completing the NLQ on behalf of the user; and
the computer-implemented method further comprises:
prior to auto-completing the NLQ on behalf of the user:
determining the classification for the user;
based at least in part on the classification, searching the one or more documents for the applicable rule keys; and
based at least in part on the applicable rule keys, filtering possibilities for the auto-completing of the NLQ on behalf of the user.

### Claim 8 (depends on 6)

The computer-implemented method of claim 6, further comprising:
creating a group where the second column value is null.

### Claim 9 (depends on 6)

The computer-implemented method of claim 6, further comprising:
creating an admin group that has access to all rows of the dataset.

### Claim 10 (depends on 6)

The computer-implemented method of claim 6, wherein the extracting, grouping, transforming, and storing occur upon receipt of the dataset and prior to receipt of any NLQs from the user.

### Claim 11 (depends on 6)

The computer-implemented method of claim 6, further comprising:
sharding rule keys stored within documents to reduce a number of rule keys per document.

### Claim 12 (depends on 11)

The computer-implemented method of claim 11, further comprising:
based at least in part on the one or more documents, deduplicating rule keys retrieved from the documents.

### Claim 13 (depends on 11)

The computer-implemented method of claim 11, further comprising:
periodically refreshing the rule keys based at least in part on updates to the rows of the dataset.

### Claim 14

One or more computer-readable media storing computer-executable instructions that, when executed, cause one or more processors to perform operations comprising:
extracting cell values with respect to a first column value in a dataset;
with respect to a second column value and a third column value, defining rule keys based at least in part on the cell values;
storing the rule keys in one or more documents of a database;
receiving, from a user, a natural language question (NLQ);
determining a classification for the user;
based at least in part on the classification, searching the one or more documents for applicable rule keys; and
based at least in part on the applicable rule keys, filtering results to the NLQ, wherein the results are from rows of the dataset.

### Claim 15 (depends on 14)

The one or more computer-readable media of claim 14, wherein:
receiving the NLQ comprises:
receiving a partial NLQ; and
auto-completing the NLQ on behalf of the user; and
the operations further comprise:
prior to auto-completing the NLQ on behalf of the user:
determining the classification for the user;
based at least in part on the classification, searching the one or more documents for the applicable rule keys; and
based at least in part on the applicable rule keys, filtering possibilities for the auto-completing of the NLQ on behalf of the user.

### Claim 16 (depends on 14)

The one or more computer-readable media of claim 14, wherein the operations further comprise:
creating a group where the second column value is null.

### Claim 17 (depends on 14)

The one or more computer-readable media of claim 14, wherein the operations further comprise:
creating an admin group that has access to all rows of the dataset.

### Claim 18 (depends on 14)

The one or more computer-readable media of claim 14, further comprising:
sharding rule keys stored within documents to reduce a number of rule keys per document.

### Claim 19 (depends on 18)

The one or more computer-readable media of claim 18, wherein the operations further comprise:
based at least in part on the one or more documents, deduplicating rule keys retrieved from the documents.

### Claim 20 (depends on 18)

The one or more computer-readable media of claim 18, wherein the operations further comprise:
periodically refreshing the rule keys based at least in part on updates to the rows of the dataset.
