LLM Query Generation With Schema Context for Security Databases

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing natural language processing systems struggle with accurately translating human queries into structured database queries due to a lack of context and reliance on statistical patterns, leading to ambiguity in interpreting queries like 'what is jay?', which could refer to the letter 'J' or the name 'Jay' or a bird species.

Innovation Solution

A system and method that utilizes a large language model (LLM) to generate database queries from natural language queries by determining a data schema and generating prompts based on the query, allowing for accurate translation and execution on security databases.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If natural language processing techniques are used to translate user queries into computer language, then ease of operation is improved, but measurement precision deteriorates due to lack of context and reliance on statistics

Engineering Contradiction:
Improveease of operationVSAvoidmeasurement precision
Core Design Contradiction:
Ease of operationVSMeasurement precision

Solution Approach 1:

The system performs preliminary actions by retrieving contextually relevant information from the database before generating the final query. The context retrieval component fetches additional information about entities mentioned in the query (e.g., retrieving that 'Jay' is a person named 'John Jay') before query generation, allowing the system to disambiguate meanings and improve translation accuracy.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary component (context retrieval mechanism) between the natural language processing and query generation stages. This intermediary retrieves contextual information from the database to resolve ambiguities in natural language queries, acting as a mediator that bridges the gap between statistical NLP and precise database querying.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If context retrieval is implemented to improve query accuracy, then measurement precision is improved, but loss of time increases due to additional retrieval steps

Engineering Contradiction:
Improvemeasurement precisionVSAvoidloss of time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs context retrieval as a preliminary action before query generation, caching relevant contextual information about entities (e.g., person names, locations) that can be reused across multiple queries. This preliminary retrieval reduces the need for repeated context fetching and minimizes time loss.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system retrieves context partially or excessively by fetching information about entities that may be relevant to future queries, not just the current query. This proactive context retrieval reduces the need for repeated retrieval operations and balances precision improvement with time efficiency.

Inventive Principle:
Principle #16Partial or excessive action

3Ease of operation

If large language model is used to generate database queries, then ease of operation is improved, but device complexity increases due to integration of LLM components

Engineering Contradiction:
Improveease of operationVSAvoiddevice complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The system segments the query processing functionality into distinct modular components: natural language processing module, context retrieval component, query generation module, and query execution module. This segmentation allows each component to be independently optimized and managed, reducing overall system complexity despite using LLM technology.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent creates a universal query processing system that can handle multiple types of queries (text queries, image queries, video queries) through a single integrated architecture. The system uses a unified approach with context retrieval and LLM-based generation that works across different query modalities, reducing complexity compared to having separate systems for each query type.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS20250370998A1System and method for natural language query processing utilizing language model techniques
Publication Date: 2025.12.04 WIZ INC
  • US20250370998A1 patent drawing
  • US20250370998A1 patent drawing
  • US20250370998A1 patent drawing

AI summary

A system and method for generating a database query based on a natural language query is presented. The method includes receiving a query directed to a security database, wherein the security database includes a representation of a computing environment; determining a data schema utilized to represent an entity of the computing environment in the security database; generating a prompt for a language model based on the received query, and the determined data schema; generating a database query by processing the generated prompt; and executing the database query on the security database.