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.

- 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.
… 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.
… 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.
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
