Microsoft · Filed Apr 30, 2025 · Published Nov 5, 2026

Microsoft Files Patent for Fixing How AI Coding Assistants Search Through Your Code

AI coding assistants often read your project in slices that can end halfway through a function. Microsoft's new patent application tries to fix that by having a second pass of AI move the cut lines so each slice makes sense on its own.

An AI coding assistant organizes a programmer's software into searchable pieces so it can find relevant code when answering questions. Drawing from patent filing US 2026/0349985 A1.
An AI coding assistant organizes a programmer's software into searchable pieces so it can find relevant code when answering questions.
See all 12 drawings from this filing ↓
Publication number US 2026/0349985 A1 US20260349985A1
Applicant Microsoft Technology Licensing, LLC
Filing date Apr 30, 2025
Publication date Nov 5, 2026
Inventors Mathieu Baptiste DEMARNE, Kai DENG, Divya VERMAREDDY, Subramaniam VENKATRAMAN KRISHNAN, Ya LIN, Yiwen ZHU, Wenjing WANG, Miso CILIMDZIC, Hannah Margrete LERNER, Swati BARARIA, Yunlei LU
US classification 707/741
Examiner WEHOVZ, OSCAR (Art Unit 2161)
Status when we published Rejected again; the company can still amend or appeal (Sep 10, 2026)
Document 20 claims

What Microsoft's code-search filing actually does

Imagine tearing a cookbook into strips of exactly equal length without reading it first. One strip ends halfway through an ingredient list, and the next starts in the middle of the instructions. Now ask a helper to find the pancake recipe. That is roughly the problem an AI coding assistant faces when it searches a big software project.

Microsoft's patent application describes a fix. It still cuts the code into equal slices, because that works for any programming language. Then an AI model looks at each slice along with its neighbors and moves the cut lines, so a whole function or section stays together.

The system also files each piece in several ways: the code itself, a plain-English description of it, and a list of other code it depends on. When you ask a question, another AI picks which of those to search.

From the filing · CLAIM 1
generating a plurality of fixed sized chunks from a codebase by dividing files of the codebase into chunks of a fixed size; generating, from the plurality of fixed sized chunks, a plurality of enhanced chunks …

Translation: The system chops up code files into uniform pieces and then improves them.

How the AI redraws the edges of each code slice

The system is built around retrieval-augmented generation, or RAG (a technique where an AI looks up outside material before answering, instead of relying only on what it learned in training). For software, the project's files must be split into chunks small enough for the model to read.

First, each file is divided into fixed-size chunks, a set number of bytes or characters. Because any programming language can be cut this way, the approach is called language-agnostic (it works without rules written for each language). Next, an "enhancement model," which can be an off-the-shelf large language model, receives each chunk plus its neighbors in a moving window and redraws the boundaries. In the filing's example, a chunk holding the middle of a method gets extended to include the method's beginning and end.

Then each enhanced chunk is indexed (made searchable as lists of numbers that capture meaning, called vector embeddings) in three ways:

  • Content index: the code itself.
  • Description index: a plain-language description written by another model.
  • Reference index: calls to code outside the chunk, plus descriptions of those calls.

At question time, a model turns your request into a search string and a search strategy. "Explain what method Y does" goes to the description index, while "where is method Y used" goes to the reference index. Several strategies can run at once, and results from multiple codebases can be ranked together.

What this means for AI coding assistants

If you use an AI coding assistant, its answers depend on whether it pulls up the right piece of code. The filing says this approach aims to cut down incomplete or irrelevant results without retraining the model, and without writing custom setup for each programming language. That matters most for companies whose projects mix several languages.

The patent examiner has issued a final rejection of this application, so no patent has been granted. Microsoft can still amend the claims or appeal. The filing also says the chunk-fixing idea could apply to other text, such as logs that are close together in time.

Microsoft's 79th filing we've tracked in our AI assistant & agent coverage since May adds to a run that includes an app-finding AI assistant and faster chatbot math.

Editorial take

The big trade here is up-front cost in exchange for easier searching later. Every slice of code gets read by one AI model, described by another, and then stored three different ways. For a large project that means a lot of AI calls and a lot of storage before anyone asks a single question.

The fixed-size starting cut also gives something up. It keeps the system working in any programming language, but a function longer than the window of neighboring slices the model sees could still get split. And a wrong description written by the AI would send searches to the wrong place with full confidence.

Still, the trade reads as worth it for code that is indexed once and searched thousands of times. The recipe is sensible and built from familiar parts. The final rejection means its path to a granted patent is steep.

Get our take in your Top Stories

Liked this breakdown? Add Patentlyze as a preferred source on Google, and our plain-English take shows up more often in your Top Stories the next time Microsoft patent news breaks.

There are more where this came from

We read every patent application Big Tech publishes and send you the ones worth knowing. Plain English, free, every week.

The drawings

12 drawing sheets from US 2026/0349985 A1 · click any drawing to enlarge

How an AI coding assistant organizes and searches project files, drawing sheet 1 from US 2026/0349985 A1
Sheet 1 How an AI coding assistant organizes and searches project files
Slicing code into clean sections so AI can search them, drawing sheet 2 from US 2026/0349985 A1
Sheet 2 Slicing code into clean sections so AI can search them
Creating a searchable catalog directly from the enhanced code sections, drawing sheet 3 from US 2026/0349985 A1
Sheet 3 Creating a searchable catalog directly from the enhanced code sections
Adding plain-text summaries to help find matching code faster, drawing sheet 4 from US 2026/0349985 A1
Sheet 4 Adding plain-text summaries to help find matching code faster
Tracking outside dependencies to find related code across files, drawing sheet 5 from US 2026/0349985 A1
Sheet 5 Tracking outside dependencies to find related code across files
Using an AI to describe external references in everyday language, drawing sheet 6 from US 2026/0349985 A1
Sheet 6 Using an AI to describe external references in everyday language
Picking the best search strategy to answer a developer query, drawing sheet 7 from US 2026/0349985 A1
Sheet 7 Picking the best search strategy to answer a developer query
Combining multiple search tactics to retrieve the most relevant code, drawing sheet 8 from US 2026/0349985 A1
Sheet 8 Combining multiple search tactics to retrieve the most relevant code
Show the other 4 sheets
Searching across multiple code projects to answer a user request, drawing sheet 9 from US 2026/0349985 A1
Sheet 9 Searching across multiple code projects to answer a user request
Ranking and filtering the most relevant code snippets from projects, drawing sheet 10 from US 2026/0349985 A1
Sheet 10 Ranking and filtering the most relevant code snippets from projects
Hardware components inside a computer running the search system, drawing sheet 11 from US 2026/0349985 A1
Sheet 11 Hardware components inside a computer running the search system
Cloud servers hosting the AI tools and developer services, drawing sheet 12 from US 2026/0349985 A1
Sheet 12 Cloud servers hosting the AI tools and developer services
Browse all the drawings 12 drawing sheets
Patent filing page

Source. Full patent text and figures from the official USPTO publication PDF.
Reader comments

Be the first to weigh in

Start the discussion

Real name or a handle, either is fine. Comments are read by a person before they appear, so allow a little time. Keep it about the filing.