Get the newsletter
Microsoft · AI / ML · Filed Feb 7, 2025 · USPTO published Aug 13, 2026 · Aug 13 release

Microsoft Patents Technology That Reads All Your Code Before AI Answers Questions

Most AI coding assistants read your code the way you might skim a novel by opening to a random page. Microsoft's new patent describes a system that first builds a map of everything in a codebase, then lets an AI fill in that map with extra context before answering any questions.

C++ source code defining a Simpleton class with state and test functions. Drawing from patent filing US 2026/0236241 A1.
C++ source code defining a Simpleton class with state and test functions.All 17 drawings ↓
Publication number
US 2026/0236241 A1(US20260236241A1)
Applicant
Microsoft Technology Licensing, LLC
Filed · Published
Feb 7, 2025 · Aug 13, 2026
Inventors
Jonathan Karl LARSON, Christopher M. TREVINO, Rodrigo Martins RACANICCI
Status when we published
Waiting for an examiner
Document
20 claims
US classification
717/144

How Microsoft's code-graph idea helps AI assistants see the full picture

Today's AI coding tools often work with whatever code you paste in front of them. They don't automatically know that the function you're asking about is called by three other files, or that a class it depends on was deprecated last month.

Microsoft's patent describes a process that reads a codebase and builds a relationship map, essentially a diagram where every function, class, and variable is a dot, and lines connect the dots that depend on each other. An AI then annotates each dot with extra information it infers from the surrounding connections.

The result is an enriched map that a subsequent AI session can consult when you ask a question. Instead of guessing from a snippet, the model can look up what your function actually connects to and give you a more grounded answer.

From the filing · CLAIM 1
… generating a graph having nodes representing the entities in the source code and edges representing relationships among the entities …

Translation: It builds a map connecting different parts of your code together based on how they relate.

How the augmented graph feeds context back into the language model

The patent describes a method called retrieval-augmented generation (RAG) applied specifically to source code. RAG is a technique where an AI is given a structured pool of reference material to look things up in before generating a response, rather than relying purely on what it learned during training.

Here the reference material is a graph (a network of nodes and edges, like a family tree) built by scanning a codebase:

  • Nodes represent code entities: functions, classes, variables, modules.
  • Edges represent relationships: this function calls that one, this class inherits from another.
  • An AI is then asked to generate augmentation data (summaries, inferred documentation, dependency notes) for each node, informed by that node's position in the graph.

The enriched result, the augmented graph, is stored and made available for later operations. When a developer asks a question about the code, the system can pull the relevant nodes and their AI-written annotations as context, giving the language model a much fuller picture than a raw snippet would provide.

The key design choice is the two-pass approach: one AI pass to build and annotate the graph, and a separate AI pass to answer the actual developer question using that graph as a reference.

From the filing · THE ABSTRACT
… prompting a generative language model to generate augmentation data for the entities based at least on the relationships …

Translation: The system asks an AI to create extra details about each code piece using those connections.

What this means for AI coding tools like GitHub Copilot

For everyday developers, this kind of system would mean an AI assistant that knows your project the way a senior teammate does, aware of which parts of the code touch each other and why. That matters most in large codebases where a single change can have consequences across dozens of files that no single developer holds in their head at once.

Microsoft owns GitHub and ships GitHub Copilot, so there is an obvious home for this kind of infrastructure. The filing is part of a broader wave of new Big Tech patents aimed at making AI coding tools more context-aware across entire repositories, not just single files.

Source: US 2026/0236241 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 · 17 sheets

17 drawing sheets from US 2026/0236241 A1 · click any drawing to enlarge

Simpleton C++ source code, drawing sheet 1 from US 2026/0236241 A1
Sheet 1 Simpleton C++ source code
Abstract syntax tree hierarchy, drawing sheet 2 from US 2026/0236241 A1
Sheet 2 Abstract syntax tree hierarchy
Code relationship graph, drawing sheet 3 from US 2026/0236241 A1
Sheet 3 Code relationship graph
Initial main and game nodes, drawing sheet 4 from US 2026/0236241 A1
Sheet 4 Initial main and game nodes
Adding game configuration node, drawing sheet 5 from US 2026/0236241 A1
Sheet 5 Adding game configuration node
Connecting player configuration node, drawing sheet 6 from US 2026/0236241 A1
Sheet 6 Connecting player configuration node
Connecting screen configuration node, drawing sheet 7 from US 2026/0236241 A1
Sheet 7 Connecting screen configuration node
Adding game-to-configuration edge, drawing sheet 8 from US 2026/0236241 A1
Sheet 8 Adding game-to-configuration edge
Show the other 9 sheets
Microsoft Patents Technology That Reads All Your Code Before AI Answers Questions patent drawing, sheet 9
Sheet 9
Microsoft Patents Technology That Reads All Your Code Before AI Answers Questions patent drawing, sheet 10
Sheet 10
Microsoft Patents Technology That Reads All Your Code Before AI Answers Questions patent drawing, sheet 11
Sheet 11
Microsoft Patents Technology That Reads All Your Code Before AI Answers Questions patent drawing, sheet 12
Sheet 12
Microsoft Patents Technology That Reads All Your Code Before AI Answers Questions patent drawing, sheet 13
Sheet 13
Microsoft Patents Technology That Reads All Your Code Before AI Answers Questions patent drawing, sheet 14
Sheet 14
Microsoft Patents Technology That Reads All Your Code Before AI Answers Questions patent drawing, sheet 15
Sheet 15
Microsoft Patents Technology That Reads All Your Code Before AI Answers Questions patent drawing, sheet 16
Sheet 16
Microsoft Patents Technology That Reads All Your Code Before AI Answers Questions patent drawing, sheet 17
Sheet 17
Patent filing page

More in AI assistant & agent

All 436 AI assistant & agent patents →