IP Library › Granted Patent US 12,730,803
Granted Patent B1
US 12,730,803 · App. 19/203,341 · Granted Sep 8, 2026

Entity-based data query system

Inventors: Sven Eberhardt (Seattle, WA); Haiying Lu (Issaquah, WA); Yangyong Zhang (San Francisco, CA)
Assignee: Samsara Inc.
G06F16/243G06F16/211
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,730,803
App. No.
19/203,341
Granted
Sep 8, 2026
Kind
B1
Abstract

Systems and methods are provided for processing natural language queries using an entity-based data query system. The system maintains a plurality of entities in an entity registry, where each entity corresponds to a data type and includes query fragments and entity attributes. Upon receiving a natural language query, the system analyzes it using a large language model (LLM) to identify referenced entities and retrieves corresponding entity information. The system constructs and executes data retrieval operations based on query fragments, providing results and entity attributes to the LLM for response generation. The system utilizes planning prompts and entity prompts to guide query processing and reduce hallucinations. Entity attributes may include retriever functions, data schemas, field mappings, and transformation rules. The system supports hierarchical entity organization and enables iterative query refinement through an interactive interface.

Claims (103)

1 . A method comprising:

maintaining a plurality of entities in an entity registry, each entity of the plurality of entities corresponding to a data type and comprising entity information that includes query fragments and entity attributes, each query fragment for each entity defining how to access and retrieve data for the data type of the entity;

receiving a natural language query from a client device;

analyzing the natural language query to identify multiple entities referenced in the query;

retrieving entity information associated with the multiple entities from the entity registry, the retrieved entity information comprising query fragments of the multiple entities and excludes entity information associated with entities not identified in the natural language query;

constructing a data retrieval operation by combining the query fragments of the multiple entities;

executing the data retrieval operation against one or more data sources to obtain result data using the combined query fragments;

determining a timestamp that indicates when data associated with at least one of the multiple entities was last updated;

providing the result data and the entity attributes of the multiple entities, including the timestamp, to a natural language processing system; and

receiving, from the natural language processing system, a response to the natural language query, the response including an indication of data recency based on the timestamp.

2 . The method of claim 1 , wherein the entity attributes comprise at least one of:

retriever functions that define how to fetch data for the entity through one or more data access protocols;

GraphQL query fragments for constructing data queries;

data schema definitions describing the structure of entity data;

field mappings that correlate entity fields with database columns;

data transformation rules for processing retrieved data;

filter specifications that define valid filtering operations for the entity;

aggregation functions for summarizing entity data;

join conditions specifying how the entity relates to other entities; and

entity relationship definitions specifying hierarchical connections to other entities.

3 . The method of claim 1 , wherein the plurality of entities are organized in a hierarchical structure, and wherein retrieving entity information comprises retrieving information from a branch of entities in the hierarchical structure.

4 . The method of claim 1 , further comprising:

analyzing the result data using the natural language processing system;

determining, based on the analysis, that additional data is needed to respond to the natural language query;

identifying additional data entities to query; and

retrieving additional result data based on the additional data entities.

5 . The method of claim 1 , wherein constructing the data retrieval operation comprises:

ranking the query fragments to execute a highest-ranking query fragment first.

6 . The method of claim 1 , further comprising:

receiving a request to add a new entity to the entity registry;

generating entity information for the new entity, including the query fragments and the entity attributes specific to the new entity; and

storing the new entity in the entity registry.

7 . The method of claim 1 , wherein the identifying the multiple entities comprises:

determining a current application context; and

activating the multiple entities based on the current application context, wherein the application context includes at least one of:

a current page or dashboard;

a chat history; or

user profile information.

8 . The method of claim 1 , wherein the analyzing the natural language query comprises using one or more of:

keyword extraction;

parts-of-speech analysis;

entity extraction models; or

machine learning models.

9 . A system comprising:

a memory; and

at least one hardware processor to perform operations comprising:

maintaining a plurality of entities in an entity registry, each entity of the plurality of entities corresponding to a data type and comprising entity information that includes query fragments and entity attributes, each query fragment for each entity defining how to access and retrieve data for the data type of the entity;

receiving a natural language query from a client device;

analyzing the natural language query to identify multiple entities referenced in the query;

retrieving entity information associated with the multiple entities from the entity registry, the retrieved entity information comprising query fragments of the multiple entities and excludes entity information associated with entities not identified in the natural language query;

constructing a data retrieval operation by combining the query fragments of the multiple entities;

executing the data retrieval operation against one or more data sources to obtain result data using the combined query fragments;

determining a timestamp that indicates when data associated with at least one of the multiple entities was last updated;

providing the result data and the entity attributes of the multiple entities, including the timestamp, to a natural language processing system; and

receiving, from the natural language processing system, a response to the natural language query, the response including an indication of data recency based on the timestamp.

10 . The system of claim 9 , wherein the entity attributes comprise at least one of:

retriever functions that define how to fetch data for the entity;

GraphQL query fragments for constructing data queries;

data schema definitions describing the structure of entity data;

field mappings that correlate entity fields with database columns;

data transformation rules for processing retrieved data;

filter specifications that define valid filtering operations for the entity;

aggregation functions for summarizing entity data;

join conditions specifying how the entity relates to other entities; and

entity relationship definitions specifying hierarchical connections to other entities.

11 . The system of claim 9 , wherein the plurality of entities are organized in a hierarchical structure, and wherein retrieving entity information comprises retrieving information from a branch of entities in the hierarchical structure.

12 . The system of claim 9 , further comprising:

analyzing the result data using the natura language processing system;

determining, based on the analysis, that additional data is needed to respond to the natural language query;

identifying additional data entities to query; and

retrieving additional result data based on the additional data entities.

13 . The system of claim 9 , wherein constructing the data retrieval operation comprises:

ranking the query fragments to execute a highest-ranking query fragment first.

14 . The system of claim 9 , further comprising:

receiving a request to add a new entity to the entity registry;

generating entity information for the new entity, including the query fragments and the entity attributes specific to the new entity; and

storing the new entity in the entity registry.

15 . A non-transitory machine-readable storage medium comprising instructions that, when executed by one or more processors of a machine, cause the machine to perform operations comprising:

maintaining a plurality of entities in an entity registry, each entity of the plurality of entities corresponding to a data type and comprising entity information that includes query fragments and entity attributes, each query fragment for each entity defining how to access and retrieve data for the data type of the entity;

receiving a natural language query from a client device;

analyzing the natural language query to identify multiple entities referenced in the query;

retrieving entity information associated with the multiple entities from the entity registry, the retrieved entity information comprising query fragments of the multiple entities and excludes entity information associated with entities not identified in the natural language query;

constructing a data retrieval operation by combining the query fragments of the multiple entities;

executing the data retrieval operation against one or more data sources to obtain result data using the combined query fragments;

determining a timestamp that indicates when data associated with at least one of the multiple entities was last updated;

providing the result data and the entity attributes of the multiple entities, including the timestamp, to a natural language processing system; and

receiving, from the natural language processing system, a response to the natural language query, the response including an indication of data recency based on the timestamp.

16 . The non-transitory machine-readable storage medium of claim 15 , wherein the entity attributes comprise at least one of:

retriever functions that define how to fetch data for the entity;

GraphQL query fragments for constructing data queries;

data schema definitions describing the structure of entity data;

field mappings that correlate entity fields with database columns;

data transformation rules for processing retrieved data;

filter specifications that define valid filtering operations for the entity;

aggregation functions for summarizing entity data;

join conditions specifying how the entity relates to other entities; and

entity relationship definitions specifying hierarchical connections to other entities.

17 . The non-transitory machine-readable storage medium of claim 15 , wherein the data entities are organized in a hierarchical structure, and wherein retrieving entity information comprises retrieving information from a branch of entities in the hierarchical structure.

18 . The non-transitory machine-readable storage medium of claim 15 , further comprising:

analyzing the result data using the natural language processing system;

determining, based on the analysis, that additional data is needed to respond to the natural language query;

identifying additional data entities to query; and

retrieving additional result data based on the additional data entities.

Assignments (2)
CORRECTIVE ASSIGNMENT TO CORRECT THE 2ND INVENTOR NAME PREVIOUSLY RECORDED AT REEL: 71071 FRAME: 457. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Feb 27, 2026
From: EBERHARDT, SVEN; LU, HAIYING; ZHANG, YANGYONG
To: SAMSARA INC.
Reel/Frame 074993/0112 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 9, 2025
From: EBERHARDT, SVEN; LU, ALLEN; ZHANG, YANGYONG
To: SAMSARA INC.
Reel/Frame 071071/0457 →
References Cited (10)
US 11113269B1 · Andrade Garcia · 2021 [cited by examiner]
US 20090254514A1 · Adair · 2009 [cited by examiner]
US 20130080472A1 · Cohen · 2013 [cited by examiner]
US 20170308573A1 · Brisebois · 2017 [cited by examiner]
US 20220179868A1 · Mortazavi · 2022 [cited by examiner]
US 20240394251A1 · Brende · 2024 [cited by examiner]
US 20250068885A1 · Poupyrev · 2025 [cited by examiner]
US 20250147957A1 · Verkruyse · 2025 [cited by examiner]
US 20250190604A1 · Fu · 2025 [cited by examiner]
US 20250200027A1 · Fu · 2025 [cited by examiner]