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

Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First

AI coding assistants are often blind to how different parts of a program connect to each other. Microsoft's new patent describes a system that builds a full map of those connections before asking the AI to do anything at all.

Integrated development environment displaying source code and artificial intelligence menu options for a software project. Drawing from patent filing US 2026/0236231 A1.
Integrated development environment displaying source code and artificial intelligence menu options for a software project.All 24 drawings ↓
Publication number
US 2026/0236231 A1(US20260236231A1)
Applicant
Microsoft Technology Licensing, LLC
Filed · Published
Feb 11, 2025 · Aug 13, 2026
Inventors
Jonathan Karl LARSON, Darren Keith EDGE, Christopher M. TREVINO, Thu Ha TRINH, Rodrigo Martins RACANICCI
Status when we published
Waiting for an examiner
Document
20 claims
US classification
717/106

How Microsoft's dependency-graph approach helps AI read code

Today's AI coding tools can stumble badly when a piece of code depends on other pieces scattered across a large project. They often miss those connections entirely, which means the code they generate can break the moment it touches the real system.

Microsoft's patent describes a fix: before the AI writes or edits a single line, the system builds a graph (a kind of map) that shows every function, class, and variable in your codebase and how they all connect to each other. When you ask the AI to change something, the system first traces that map to find everything your request depends on, then hands all that context to the AI along with your instruction.

The result is that the AI gets a much fuller picture of your code before it starts working. Instead of guessing what the rest of your project looks like, it can see the connections that matter most to the task at hand.

From the filing · CLAIM 1
… accessing a graph having nodes representing the entities in the source code and edges representing relationships among individual entities; resolving dependencies of the particular entity by traversing the graph …

Translation: The system maps out how different parts of your code connect to each other so the AI understands the full context.

How the graph traversal feeds context into the AI prompt

The patent describes a two-stage process. In the first stage, the system reads through a codebase and identifies entities (functions, classes, variables, modules) and the relationships between them, then stores all of that as a graph (a network of nodes and edges, where each node is an entity and each edge is a relationship like "calls," "imports," or "inherits from"). A generative AI model is then prompted to enrich each node with extra descriptive data, producing what the patent calls an augmented graph.

In the second stage, when a developer makes a request ("refactor this function," "explain what this class does," "add error handling here"), the system identifies the specific entity involved, then traverses the graph (follows the edges outward, tracing all the dependencies of that entity through the map). Those dependencies are collected and bundled into the prompt sent to the AI.

Key components include:

  • Entity extraction: parsing source code to identify named building blocks
  • Graph construction: mapping how those building blocks relate to each other
  • Dependency resolution: walking the graph to find everything a given entity relies on
  • Augmented prompting: packaging the dependency context into the AI's instruction

This approach falls under the broader category of retrieval-augmented generation (RAG), a technique where an AI is given relevant documents or data at query time rather than relying only on what it learned during training. Here, the "retrieved" data is the graph context specific to the code in question.

From the filing · THE ABSTRACT
… generating a graph having nodes representing the entities in the source code and edges representing relationships among the entities. The example method also includes prompting a generative language model to generate augmentation data for the entities …

Translation: The software builds a map of your code and asks the AI to create extra information about how those pieces work together.

What this means for AI coding tools like GitHub Copilot

For developers using AI coding tools, the practical pain point is real: ask an AI to modify a function buried deep in a large project and it frequently produces code that breaks other parts of the system because it had no idea those other parts existed. A graph-based approach to context retrieval directly targets that failure mode, and it scales in a way that stuffing an entire codebase into a prompt does not.

Microsoft owns GitHub and GitHub Copilot, the most widely used AI coding assistant on the market, which makes this filing more than academic. The dependency-graph architecture described here is the sort of infrastructure change that would show up invisibly to users but produce noticeably fewer broken suggestions. It sits alongside a wave of new tech patents in the AI-assisted development space that are reshaping how code generation tools handle large, real-world codebases.

Source: US 2026/0236231 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 · 24 sheets

24 drawing sheets from US 2026/0236231 A1 · click any drawing to enlarge

Source code snippet, drawing sheet 1 from US 2026/0236231 A1
Sheet 1 Source code snippet
Abstract syntax tree hierarchy, drawing sheet 2 from US 2026/0236231 A1
Sheet 2 Abstract syntax tree hierarchy
Code relationship graph, drawing sheet 3 from US 2026/0236231 A1
Sheet 3 Code relationship graph
Initial codebase node, drawing sheet 4 from US 2026/0236231 A1
Sheet 4 Initial codebase node
Connected codebase nodes, drawing sheet 5 from US 2026/0236231 A1
Sheet 5 Connected codebase nodes
Expanding codebase connection, drawing sheet 6 from US 2026/0236231 A1
Sheet 6 Expanding codebase connection
Fully linked codebase branches, drawing sheet 7 from US 2026/0236231 A1
Sheet 7 Fully linked codebase branches
Integrated codebase dependency edge, drawing sheet 8 from US 2026/0236231 A1
Sheet 8 Integrated codebase dependency edge
Show the other 16 sheets
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 9
Sheet 9
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 10
Sheet 10
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 11
Sheet 11
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 12
Sheet 12
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 13
Sheet 13
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 14
Sheet 14
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 15
Sheet 15
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 16
Sheet 16
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 17
Sheet 17
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 18
Sheet 18
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 19
Sheet 19
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 20
Sheet 20
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 21
Sheet 21
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 22
Sheet 22
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 23
Sheet 23
Microsoft Patents a Way to Give AI Coders a Full Map of Your Codebase First patent drawing, sheet 24
Sheet 24
Patent filing page

More in AI assistant & agent

All 436 AI assistant & agent patents →