Context-Dependent Query Generation Using Dual Language Models

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Queries used to retrieve information from databases or knowledge graphs often become unusable when transferred between different environments or data structures, requiring time-consuming modifications and potentially resulting in errors due to undetected incompatibilities.

Innovation Solution

The use of large language models, where one model generates queries adapted to a custom schema for database-stored data and another model detects issues in the generated queries, allowing for environment-specific query generation and issue identification.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If queries are transferred between different environments or data structures, then query reusability is improved, but query compatibility deteriorates

Engineering Contradiction:
Improvequery reusabilityVSAvoidquery compatibility
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent introduces an intermediary translation layer that converts queries from source environment syntax to target environment syntax. This intermediary mechanism allows queries to be reused across different environments while maintaining compatibility through automatic adaptation, resolving the contradiction between query reusability and environment-specific compatibility requirements.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system dynamically changes query parameters including syntax structure, data type mappings, and environment-specific configurations when transferring queries between environments. By automatically adjusting these parameters based on the target environment characteristics, the system maintains query compatibility while enabling cross-environment reusability.

Inventive Principle:
Principle #35Parameter changes

2Reliability

If queries are manually modified for new environments, then query compatibility is improved, but time consumption and labor increase

Engineering Contradiction:
Improvequery compatibilityVSAvoidquery modification time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary actions by pre-defining environment configurations, data type mappings, and translation rules in a knowledge base. When a query needs to be transferred to a new environment, these pre-configured elements are automatically applied, eliminating the need for manual modification and significantly reducing time consumption while maintaining compatibility.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The query translation system operates autonomously by automatically detecting the target environment, selecting appropriate translation rules, and executing the conversion without human intervention. This self-service capability resolves the contradiction by providing compatibility assurance through automated processes rather than time-consuming manual modifications.

Inventive Principle:
Principle #25Self-service

3Productivity

If new queries are implemented without validation, then implementation speed is improved, but error detection capability deteriorates

Engineering Contradiction:
Improvequery implementation speedVSAvoiderror detection capability
Core Design Contradiction:
ProductivityVSDifficulty of detecting and measuring

Solution Approach 1:

The system implements a feedback mechanism where generated queries are automatically validated against the target environment schema and constraints. Error detection results are fed back to the generation process, allowing immediate correction of incompatibilities. This feedback loop maintains high implementation speed by automating validation rather than requiring manual error checking.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system applies preliminary anti-action by proactively detecting and preventing errors before query execution. Through pre-validation against environment schemas and constraint checking, the system identifies potential incompatibilities in generated queries and either corrects them automatically or flags them for review, thereby maintaining both implementation speed and error detection capability.

Inventive Principle:
Principle #9Preliminary anti-action

Data Source

PatentUS20250110949A1Context-dependent query generation
Publication Date: 2025.04.03 CAPITAL ONE SERVICES LLC
  • US20250110949A1 patent drawing
  • US20250110949A1 patent drawing
  • US20250110949A1 patent drawing

AI summary

A method and related system for generating and presenting queries is disclosed. The method includes selecting a first context based on a set of inputs including a first query and determining a match between the first context and a stored context associated with a schema. The method further includes generating a second query based on the set of inputs with a first language model in response to the determination of the match and identifying an indicated portion of the second query by providing, as a second input, the second query to a second language model. The method also includes generating data, the data including an issue indicator of the second query based on the indicated portion; and sending the data to the client device.