Get the newsletter
Microsoft · AI / ML · Filed Aug 17, 2025 · USPTO published Nov 26, 2026 · This week's release

Microsoft Patents an AI Agent That Fixes Slow Code and Checks Its Own Work

Some of the sneakiest software bugs never crash anything. They just make a program sluggish and memory-hungry. Microsoft's patent describes an AI that hunts those bugs down and measures its own fix.

An AI system that scans a slow computer program, rewrites the problematic sections, and runs speed tests to confirm the software runs faster. Drawing from patent filing US 2026/0377148 A1.
An AI system that scans a slow computer program, rewrites the problematic sections, and runs speed tests to confirm the software runs faster.All 9 drawings ↓
Publication number
US 2026/0377148 A1(US20260377148A1)
USPTO patent title:
Agentic Approach to Fixing Software Performance Bugs
Applicant
MICROSOFT TECHNOLOGY LICENSING, LLC.
Filed · Published
Aug 17, 2025 · Nov 26, 2026
Inventors
SPANDAN GARG, NEELAKANTAN SUNDARESAN, ROSHANAK ZILOUCHIAN MOGHADDAM
Status when we published
Waiting for an examiner
Document
20 claims
US classification
717/106
Parent application
Claims priority from a provisional application 63810533 (filed May 22, 2025)

What Microsoft's code-fixing AI agent actually does

Every time an app feels sluggish or gobbles up your computer's memory, a programmer somewhere has to track down why. The code usually isn't broken. It gives the right answer, just slowly, so nothing crashes and nobody gets an alert.

Microsoft's patent describes an AI agent that takes over that chore. Given a report naming the slow piece of code, it first measures how that code performs today. Then it asks an AI language model what to do next, tries a fix, and measures again. If the numbers didn't improve, it tries another fix.

Only when the before-and-after test shows a real gain does it hand the repaired code back. No engineer has to babysit the process.

From the filing · CLAIM 1
… excessive central processing unit (CPU) usage or excessive memory allocations in the target method …

Translation: The system targets software that wastes computer processing power or memory.

How the agent benchmarks, patches and rechecks

The system starts with a bug report that names a target method (a specific chunk of code) and says it uses too much CPU time or makes too many memory allocations (grabs of memory while running). The claims cover those two kinds of problem.

An AI agent does the work: a control program paired with a large language model (the type of AI behind chatbots). The control program has developer tools and access to the codebase. It gives the model an issue description and an ordered to-do list:

  • Run a first benchmark test (a timed trial that records CPU and memory use) on the code as it is.
  • Write the repair.
  • Run a second benchmark with the repair in place.
  • Check that performance actually improved.

The model never touches the code itself. It answers one question at a time: what should the control program do next? The control program runs that command, records the result, and asks again. Because the AI service remembers nothing between requests, each request carries the full conversation log of everything said and done so far.

The loop ends once the fix is verified. One dependent claim defines that as at least one metric improving without the others getting worse. The agent can also run inside an isolated container, walled off from other software.

From the filing · THE ABSTRACT
… generates repair code for a software program having a performance bug that is verified to improve the performance of the software program autonomously without user intervention …

Translation: The artificial intelligence fixes slow software by itself and tests the result.

Why Microsoft is aiming AI at slow code

Slow software costs real money and patience: apps drain batteries, and servers need more hardware to do the same job. Because these bugs crash nothing, they can sit in code for ages, and finding them by hand means engineers combing through profiler output (a report showing where a program spends its time). This patent aims to hand that chore to a machine with a built-in check.

The filing's example is a C# QR code generator. The agent swapped one method call for another, and the benchmark showed memory use falling from 98.11 MB to 96.74 MB and average run time from 184.5 ms to 182.6 ms. A small gain, but it was measured. You would feel the effect indirectly, as faster and leaner apps from developers who use tools like this.

Microsoft's 44th filing we've tracked since July in our AI agents acting for you watch follows one on cloud code tracing and one on a pre-emptive meeting helper.

Source: US 2026/0377148 A1 at the USPTO (PDF). Full patent text and figures are in the official publication.

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 the new patents from Big Tech, carmakers and more and send you the ones worth knowing. Plain English, free, every week.

The drawings · 9 sheets

9 drawing sheets from US 2026/0377148 A1 · click any drawing to enlarge

Main parts of the automated coding assistant, drawing sheet 1 from US 2026/0377148 A1
Sheet 1 Main parts of the automated coding assistant
Steps the AI takes to fix slow software, drawing sheet 2 from US 2026/0377148 A1
Sheet 2 Steps the AI takes to fix slow software
A bug report fed into the AI model, drawing sheet 3 from US 2026/0377148 A1
Sheet 3 A bug report fed into the AI model
Step by step instructions helping the AI fix bugs, drawing sheet 4 from US 2026/0377148 A1
Sheet 4 Step by step instructions helping the AI fix bugs
Finding the slow lines of code inside a project, drawing sheet 5 from US 2026/0377148 A1
Sheet 5 Finding the slow lines of code inside a project
Testing current software speed before applying a patch, drawing sheet 6 from US 2026/0377148 A1
Sheet 6 Testing current software speed before applying a patch
Applying the proposed fix and measuring new speed, drawing sheet 7 from US 2026/0377148 A1
Sheet 7 Applying the proposed fix and measuring new speed
Comparing before and after performance to verify the fix, drawing sheet 8 from US 2026/0377148 A1
Sheet 8 Comparing before and after performance to verify the fix
Show sheet 9
Computers that run the AI and test code repairs, drawing sheet 9 from US 2026/0377148 A1
Sheet 9 Computers that run the AI and test code repairs
Patent filing page

More in AI assistant & agent

All 458 AI assistant & agent patents →

Watchlists this filing belongs to

All watchlists →
Reader comments

No comments yet

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.