Context-Aware Prompt Retrieval Using Semantic Embeddings

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional indexing techniques struggle to provide accurate results when search queries lack precise contextual information, leading to inefficiencies and information overload in retrieving relevant prompts for large language models (LLMs).

Innovation Solution

Employing context-aware techniques using text embedding and semantic search to identify the closest match between user input and stored prompts, narrowing down the search space and providing highly relevant prompts efficiently.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If conventional indexing techniques are used to retrieve prompts from a repository, then the system can handle basic search queries, but the accuracy of results deteriorates when search queries lack precise contextual information

Engineering Contradiction:
Improveprompt retrieval accuracyVSAvoidcontext understanding capability
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent transforms prompts from simple text strings into enriched data structures that include embeddings (vector representations capturing semantic meaning) and metadata. This parameter transformation enables the system to move from exact matching to semantic similarity-based matching, significantly improving retrieval accuracy for vague or context-limited queries while maintaining adaptability across diverse search scenarios.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent introduces embeddings as an intermediary layer between the query and the prompt repository. Instead of directly comparing text strings, the system converts both queries and stored prompts into embedding vectors, which serve as semantic mediators that capture contextual meaning. This intermediary mechanism enables accurate retrieval even when queries lack precise contextual information.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If the system searches through a large repository of prompts without context-aware techniques, then it can maintain simple processing, but it leads to information overload and inefficiency in retrieving relevant prompts

Engineering Contradiction:
Improveprompt retrieval efficiencyVSAvoidrelevant prompt identification
Core Design Contradiction:
ProductivityVSLoss of information

Solution Approach 1:

The patent segments the prompt retrieval process into distinct stages: (1) converting queries and prompts to embeddings, (2) computing similarity scores between query embedding and stored prompt embeddings, (3) ranking prompts based on similarity scores, and (4) returning top-ranked results. This segmentation enables efficient processing of large repositories by breaking down the complex search task into manageable, optimized sub-tasks.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary conversion of stored prompts into embedding vectors and stores these embeddings alongside the prompt text. This pre-processing action eliminates the need to re-compute embeddings during actual search operations, significantly improving retrieval efficiency. The embeddings are prepared in advance, ready for rapid similarity comparison when queries are submitted.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If multiple API calls to LLMs are made to evaluate different prompts, then the system can find optimal prompts through trial and error, but computational resources and costs increase significantly

Engineering Contradiction:
Improveprompt effectivenessVSAvoidcomputational resource consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent replaces the mechanical trial-and-error approach (making multiple sequential API calls to LLMs to test different prompts) with a computational similarity-based approach using embeddings. Instead of invoking expensive LLM API calls repeatedly, the system uses efficient vector similarity computations to predict prompt effectiveness, dramatically reducing computational resource consumption while maintaining reliable prompt selection.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent creates embedding copies of the original prompts that capture their semantic essence. These embedding representations serve as lightweight proxies that can be rapidly compared and evaluated without requiring actual LLM inference. This copying mechanism allows the system to pre-evaluate and rank prompts based on their embeddings before making any API calls, minimizing computational resource usage.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS20250315691A1Context-aware prompt matching system using large language models
Publication Date: 2025.10.09 ORACLE INT CORP
  • US20250315691A1 patent drawing
  • US20250315691A1 patent drawing
  • US20250315691A1 patent drawing

AI summary

Techniques for a context-aware prompt matching system using large language models (LLMs) are provided. In one technique, a first LLM receives input that comprises a prompt for a second LLM and accesses a set of prompts. Based on the set of prompts and the prompt, the first LLM identifies a subset of the set of prompts. A particular embedding is generated based on the prompt. For each embedding in a set of embeddings, each of which corresponds to a different prompt in the subset, a similarity score is generated between that embedding and the particular embedding. The set of embeddings are ranked based on the generated similarity scores. A highest ranked embedding, in the set of embeddings, that corresponds to a particular prompt in the subset is identified. The particular prompt may be automatically input to the second LLM or may be presented to a user for selection.