# US 2026/0064384 A1 · Context-aware code generation and modification

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0064384 A1
- Document ID: US20260064384A1
- Status: Published application
- Kind: A1
- Application number: 19/309,855
- Filed: 2025-08-26
- Published: 2026-03-05
- Earliest claimed: 2024-09-03
- Assignees: For Good AI Inc.
- Applicants: For Good AI Inc.
- Inventors: Andrey Filev; Dmitrii Krasnov
- Web page: https://patentgrep.com/patent/US20260064384A1

## CPC

- G06F 8/36: Software reuse
- G06F 8/30: Creation or generation of source code
- G06F 8/311: {Functional or applicative languages; Rewrite languages}
- G06F 8/33: Intelligent editors
- G06F 8/34: Graphical or visual programming
- G06F 8/35: model driven
- G06F 8/427: {Parsing}
- G06F 8/72: Code refactoring
- G06F 8/75: Structural analysis for program understanding
- G06F 8/77: Software metrics
- G06F 11/362: Debugging of software
- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3692: {for test results analysis}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 16/137: {Hash-based (content-based indexing of textual data G06F16/31)}
- G06F 16/2237: {Vectors, bitmaps or matrices}
- G06F 16/24575: {using context}
- G06F 16/3347: {using vector based model}
- G06F 40/30: Semantic analysis
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system and method for generating computer code are provided. The system receives data indicating a trigger event to initiate code generation and selects a code generation agent based on attributes of the trigger event. The selected agent requests indexed context information from a context indexing component. The context indexing component generates indexed context information including project data associated with a user account, such as existing code, text data, file structure data, open file information, and project documentation. First embeddings are generated from the processed project data and stored in a vector database configured to be queried by the code generation agent. The system can further generate environmental data, hierarchical file structure summarizations, and indexed external data, creating additional embeddings stored in the vector database to provide comprehensive context for code generation.

## Claims

### Claim 1

A system comprising:
one or more processors; and
non-transitory computer-readable media storing computer-executable instructions that, when executed by the one or more processors, cause the system to perform operations comprising:
generating, by a context indexing component, indexed context information including project data comprising at least existing computer code associated with a user account;
storing the indexed context information in a database, the database configured to be queried by code generation agents during computer code generation sessions;
receiving a query for a computer code generation component of the system to initiate generation of patched computer code in a computer code generation session;
selecting, based at least in part on attributes of the query, a code generation agent to generate the patched computer code;
retrieving, by the code generation agent that was selected, the indexed context information from the database;
generating, utilizing a large language model (LLM) and static code analysis and based at least in part on the existing computer code, hunks indicative of errors in the existing computer code;
patching the existing computer code based at least in part on inserting portions of computer code into the existing computer code according to the hunks such that the patched computer code is generated; and
sending, by the code generation agent that was selected, the patched computer code that was generated to a device from which the query was received.

### Claim 2 (depends on 1)

The system of claim 1, the operations further comprising:
generating, based at least in part on the static code analysis, diagnostics data indicative of the errors in the existing computer code based at least in part on a diagnostics component of the system processing the existing computer code;
filtering, utilizing the diagnostics component, the errors indicated by the diagnostics data such that filtered diagnostics data is generated, the filtered diagnostics data indicating types of the errors in the existing computer code; and
wherein the errors are organized within the hunks based at least in part on the types of the errors indicated by the filtered diagnostics data.

### Claim 3 (depends on 2)

The system of claim 2, wherein the types of the errors include at least one of:
syntax errors;
compilation errors;
runtime errors;
logical errors;
resource errors;
arithmetic errors;
semantic errors; or
interface errors.

### Claim 4 (depends on 1)

The system of claim 1, the operations further comprising, prior to generating the patched computer code:
generating first data representative of changes in the patched computer code with respect to the existing computer code; and
sending the first data to a device from which the query was received, the first data causing an integrated development environment (IDE) extension to display the changes in the patched computer code on the device.

### Claim 5 (depends on 4)

The system of claim 4, the operations further comprising, prior to generating the patched computer code:
receiving, responsive to the first data and from the device, second data representing at least one of an acceptance, a rejection, or a modification associated with the changes in the patched computer code; and
based at least in part on the second data, at least one of:
patching the existing computer code to generate the patched computer code based at least in part on the acceptance;
patching the existing computer code to generate the patched computer code based at least in part on the modification; or
refraining from generating the patched computer code.

### Claim 6 (depends on 1)

The system of claim 1, wherein the hunks include first hunks and second hunks, and the operations further comprising:
generating patching instructions from the hunks as processed by the selected code generation agent, the patching instructions indicating an order in which to process the hunks when patching the existing computer code in the computer code generation session; and
patching the existing computer code utilizing the hunks and based at least in part on the patching instructions, wherein patching the existing computer code utilizing the hunks comprises:
patching a first portion of the existing computer code utilizing the first hunks; and
patching a second portion of the existing computer code utilizing the second hunks after patching the first portion of the existing computer code.

### Claim 7 (depends on 1)

The system of claim 1, the operations further comprising:
generating first data representing a toggle element of an integrated development environment (IDE) associated with the user account, the toggle being configured with:
a first toggle position enabling execution of the generation of the patched computer code without receiving user input indicating approval of the patching of the existing computer code; and
a second toggle position preventing execution of the generation of the patched computer code without receiving the user input indicating the approval of the patching of the existing computer code.

### Claim 8

A method comprising:
generating, by a context indexing component, indexed context information including project data comprising at least existing computer code associated with a user account;
storing the indexed context information in a database, the database configured to be queried by code generation agents during computer code generation sessions;
receiving a query for a computer code generation component of the system to initiate generation of patched computer code in a computer code generation session;
selecting, based at least in part on attributes of the query, a code generation agent to generate the patched computer code;
retrieving, by the code generation agent that was selected, the indexed context information from the database;
generating, utilizing a large language model (LLM) and static code analysis and based at least in part on the existing computer code, hunks indicative of errors in the existing computer code;
patching the existing computer code based at least in part on inserting portions of computer code into the existing computer code according to the hunks such that the patched computer code is generated; and
sending, by the code generation agent that was selected, the patched computer code that was generated to a device from which the query was received.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
generating, based at least in part on the static code analysis, diagnostics data indicative of the errors in the existing computer code based at least in part on a diagnostics component of the system processing the existing computer code;
filtering, utilizing the diagnostics component, the errors indicated by the diagnostics data such that filtered diagnostics data is generated, the filtered diagnostics data indicating types of the errors in the existing computer code; and
wherein the errors are organized within the hunks based at least in part on the types of the errors indicated by the filtered diagnostics data.

### Claim 10 (depends on 9)

The method of claim 9, wherein the types of errors include at least one of:
syntax errors;
compilation errors;
runtime errors;
logical errors;
resource errors;
arithmetic errors;
semantic errors; or
interface errors.

### Claim 11 (depends on 8)

The method of claim 8, further comprising, prior to generating the patched computer code:
generating first data representative of changes in the patched computer code with respect to the existing computer code; and
sending the first data to a device from which the query was received, the first data causing an integrated development environment (IDE) extension to display the changes in the patched computer code on the device.

### Claim 12 (depends on 11)

The method of claim 11, further comprising, prior to generating the patched computer code:
receiving, responsive to the first data and from the device, second data representing at least one of an acceptance, a rejection, or a modification associated with the changes in the patched computer code; and
based at least in part on the second data, at least one of:
patching the existing computer code to generate the patched computer code based at least in part on the acceptance;
patching the existing computer code to generate the patched computer code based at least in part on the modification; or
refraining from generating the patched computer code.

### Claim 13 (depends on 8)

The method of claim 8, wherein the hunks include first hunks and second hunks, and the method further comprising:
generating patching instructions from the hunks as processed by the selected code generation agent, the patching instructions indicating an order in which to process the hunks when patching the existing computer code in the computer code generation session; and
patching the existing computer code utilizing the hunks and based at least in part on the patching instructions, wherein patching the existing computer code utilizing the hunks comprises:
patching a first portion of the existing computer code utilizing the first hunks; and
patching a second portion of the existing computer code utilizing the second hunks after patching the first portion of the existing computer code.

### Claim 14 (depends on 8)

The method of claim 8, further comprising:
generating first data representing a toggle element of an integrated development environment (IDE) associated with the user account, the toggle being configured with:
a first toggle position enabling execution of the generation of the patched computer code without receiving user input indicating approval of the patching of the existing computer code; and
a second toggle position preventing execution of the generation of the patched computer code without receiving the user input indicating the approval of the patching of the existing computer code.

### Claim 15

One or more non-transitory computer-readable media storing instructions that, when executed by one or more processors, cause the processors to perform operations comprising:
generating, by a context indexing component, indexed context information including project data comprising at least existing computer code associated with a user account;
storing the indexed context information in a database, the database configured to be queried by code generation agents during computer code generation sessions;
receiving a query for a computer code generation component of the system to initiate generation of patched computer code in a computer code generation session;
selecting, based at least in part on attributes of the query, a code generation agent to generate the patched computer code;
retrieving, by the code generation agent that was selected, the indexed context information from the database;
generating, utilizing a large language model (LLM) and static code analysis and based at least in part on the existing computer code, hunks indicative of errors in the existing computer code;
patching the existing computer code based at least in part on inserting portions of computer code into the existing computer code according to the hunks such that the patched computer code is generated; and
sending, by the code generation agent that was selected, the patched computer code that was generated to a device from which the query was received.

### Claim 16 (depends on 15)

The one or more non-transitory computer-readable media of claim 15, the operations further comprising:
generating, based at least in part on the static code analysis, diagnostics data indicative of the errors in the existing computer code based at least in part on a diagnostics component of the system processing the existing computer code;
filtering, utilizing the diagnostics component, the errors indicated by the diagnostics data such that filtered diagnostics data is generated, the filtered diagnostics data indicating types of the errors in the existing computer code; and
wherein the errors are organized within the hunks based at least in part on the types of the errors indicated by the filtered diagnostics data.

### Claim 17 (depends on 16)

The one or more non-transitory computer-readable media of claim 16, wherein the types of the errors include at least one of:
syntax errors;
compilation errors;
runtime errors;
logical errors;
resource errors;
arithmetic errors;
semantic errors; or
interface errors.

### Claim 18 (depends on 13)

The one or more non-transitory computer-readable media of claim 13, the operations further comprising, prior to generating the patched computer code:
generating first data representative of changes in the patched computer code with respect to the existing computer code; and
sending the first data to a device from which the query was received, the first data causing an integrated development environment (IDE) extension to display the changes in the patched computer code on the device.

### Claim 19 (depends on 18)

The one or more non-transitory computer-readable media of claim 18, the operations further comprising, prior to generating the patched computer code:
receiving, responsive to the first data and from the device, second data representing at least one of an acceptance, a rejection, or a modification associated with the changes in the patched computer code; and
based at least in part on the second data, at least one of:
patching the existing computer code to generate the patched computer code based at least in part on the acceptance;
patching the existing computer code to generate the patched computer code based at least in part on the modification; or
refraining from generating the patched computer code.

### Claim 20 (depends on 15)

The one or more non-transitory computer-readable media of claim 15, wherein the hunks include first hunks and second hunks, and the operations further comprising:
generating patching instructions from the hunks as processed by the selected code generation agent, the patching instructions indicating an order in which to process the hunks when patching the existing computer code in the computer code generation session; and
patching the existing computer code utilizing the hunks and based at least in part on the patching instructions, wherein patching the existing computer code utilizing the hunks comprises:
patching a first portion of the existing computer code utilizing the first hunks; and
patching a second portion of the existing computer code utilizing the second hunks after patching the first portion of the existing computer code.
