Semantic Code Chunk Search for Developer Query Response

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional developer tools rely on exact string matching for code search, lacking the ability to highlight semantically related keywords, which hinders efficient code development by requiring additional time and resources to understand relevance.

Innovation Solution

A system that parses codebases into chunks and identifies semantically related keywords, highlighting these in the relevant code chunks to provide context for user queries, reducing the need for additional processing to determine relevance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If exact string matching is used for code search, then search precision is maintained, but search efficiency and user understanding of relevance deteriorate

Engineering Contradiction:
Improvesearch precisionVSAvoidsearch efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The system transforms the search parameter from exact string matching to semantic similarity matching using embedding vectors. This allows the search to capture conceptual relevance rather than literal text matches, improving both precision and efficiency by understanding the meaning of code elements.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent replaces the mechanical exact-matching mechanism with an AI-based semantic analysis system. The system uses machine learning models to generate embeddings and calculate semantic similarity, substituting rigid string comparison with flexible meaning-based matching.

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

2Loss of information

If semantically related keywords are identified and highlighted, then user understanding of relevance is improved, but processing time and computational resources increase

Engineering Contradiction:
Improvecontext informationVSAvoidprocessing time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The system performs preliminary action by pre-computing embedding vectors for code elements and storing them in advance. When a search query is executed, these pre-computed embeddings are immediately used for similarity calculation, avoiding the need to compute embeddings during the search process itself.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent segments the codebase into discrete code elements (functions, classes, variables) and computes semantic embeddings for each segment independently. This segmentation allows for efficient storage and retrieval, enabling rapid similarity search without processing the entire codebase as a single unit.

Inventive Principle:
Principle #1Segmentation

3Measurement precision

If AI models are used to identify semantically related keywords, then keyword identification accuracy is improved, but computational complexity increases

Engineering Contradiction:
Improvekeyword identification accuracyVSAvoidcomputational complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The system extracts the complex AI-based semantic analysis functionality into a separate, dedicated service or library. This modularization allows the main application to use simple API calls while the complex embedding generation and similarity calculation are handled by specialized components, reducing the apparent complexity in the primary codebase.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS20260030280A1Query response generation in a developer tool using semantically related keywords in relevant code chunks
Publication Date: 2026.01.29 MICROSOFT TECHNOLOGY LICENSING LLC
  • US20260030280A1 patent drawing
  • US20260030280A1 patent drawing
  • US20260030280A1 patent drawing

AI summary

Techniques are described herein that are capable of responding to a query in a developer tool using semantically related keywords in relevant code chunks. A user-generated query regarding a location of an element in a codebase of a software development project is received. The codebase is parsed into code chunks. Semantically related keywords, including keywords from the user-generated query and other keywords that are semantically related to the keywords, are identified. Relevant code chunks are selected from the code chunks based on satisfaction of a relevancy criterion regarding the user-generated query. Execution of an instruction is triggered, which causes a visual representation of a response to the user-generated query to be generated. The execution of the instruction causes the visual representation to include at least portions of the relevant code chunks and further causes at least a subset of the semantically related keywords to be highlighted in the portions.