# US 2026/0064387 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/0064387 A1
- Document ID: US20260064387A1
- Status: Published application
- Kind: A1
- Application number: 19/309,790
- Filed: 2025-08-26
- Published: 2026-03-05
- Earliest claimed: 2024-09-03
- Assignees: For Good Al Inc.
- Applicants: For Good Al Inc.
- Inventors: Andrey Filev; Dmitrii Krasnov
- Web page: https://patentgrep.com/patent/US20260064387A1

## 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:
receiving first data indicating that a trigger event has occurred, the trigger event indicating that initiation of generation of patched computer code in a computer code generation session is to occur;
selecting, based at least in part on attributes of the trigger event, a code generation agent to generate the patched computer code;
identifying, based at least in part on attributes of the trigger event, existing computer code associated with a device associated with the trigger event;
receiving new computer code generated based at least in part on the existing computer code;
generating diagnostics data indicative of errors in the existing computer code based at least in part on a diagnostics component associated with the selected code generation agent processing the existing computer code and the new computer code;
generating filtered diagnostics data indicating types of the errors indicated by the diagnostics data;
generating, utilizing a large language model (LLM), hunks indicative of the errors in the existing computer code, 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; and
patching the existing computer code utilizing the hunks such that the patched computer code is generated in the computer code generation session.

### Claim 2 (depends on 1)

The system of claim 1, the operations further comprising:
generating, by a context indexing component, indexed context information associated with the computer code generation session;
storing the indexed context information in a database, the database configured to be queried by the code generation agent to generate the patched computer code;
retrieving, based at least in part on the code generation agent that was selected querying the database, the indexed context information associated with the computer code generation session; and
wherein generating the patched computer code in the computer code generation session is further based at least in part on the selected code generation agent querying the database.

### Claim 3 (depends on 2)

The system of claim 2, wherein the indexed context information includes at least one of:
project data associated with the computer code generation session, the project data comprising at least one of the previous computer code associated with a user account, text data associated with the user account, file structure data associated with the user account, open file information associated with the user account, or project documentation associated with the computer code generation session;
environmental data associated with the computer code generation session, the environmental data comprising at least library information indicating one or more libraries installed on a user device associated with the user account, operating system information indicating details of an operating system utilized by the user account, and database information indicating details of one or more databases utilized by the user account;
synthetic information associated with the project data, the synthetic information being based at least in part on information extracted from the existing computer code; or
indexed external data including at least external documents that are not specific to the user account, languages and frameworks specifications, security vulnerability database information, and related public documents.

### 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 previous computer code; and
sending the first data to a device associated with the trigger event, the first data causing an integrated development environment (IDE) extension to display the changes in the patched computer code on the device.

### Claim 5

A method comprising:
receiving first data indicating that a trigger event has occurred, the trigger event indicating that initiation of generation of patched computer code in a computer code generation session is to occur;
selecting, based at least in part on attributes of the trigger event, a code generation agent to generate the patched computer code;
identifying, based at least in part on attributes of the trigger event, existing computer code associated with a device associated with the trigger event;
receiving new computer code generated based at least in part on the existing computer code;
generating diagnostics data indicative of errors in the existing computer code based at least in part on a diagnostics component associated with the selected code generation agent processing the existing computer code and the new computer code;
generating filtered diagnostics data indicating types of the errors indicated by the diagnostics data;
generating, utilizing a large language model (LLM), hunks indicative of the errors in the existing computer code, 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; and
patching the existing computer code utilizing the hunks such that the patched computer code is generated in the computer code generation session.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
generating, by a context indexing component, indexed context information associated with the computer code generation session;
storing the indexed context information in a database, the database configured to be queried by the code generation agent to generate the patched computer code;
retrieving, based at least in part on the code generation agent that was selected querying the database, the indexed context information associated with the computer code generation session; and
wherein generating the patched computer code in the computer code generation session is further based at least in part on the selected code generation agent querying the database.

### Claim 7 (depends on 6)

The method of claim 6, wherein the indexed context information includes at least one of:
project data associated with the computer code generation session, the project data comprising at least one of the existing computer code associated with a user account, text data associated with the user account, file structure data associated with the user account, open file information associated with the user account, or project documentation associated with the computer code generation session;
environmental data associated with the computer code generation session, the environmental data comprising at least library information indicating one or more libraries installed on a user device associated with the user account, operating system information indicating details of an operating system utilized by the user account, and database information indicating details of one or more databases utilized by the user account;
synthetic information associated with the project data, the synthetic information being based at least in part on information extracted from the existing computer code; or
indexed external data including at least external documents that are not specific to the user account, languages and frameworks specifications, security vulnerability database information, and related public documents.

### Claim 8 (depends on 5)

The method of claim 5, wherein the diagnostics data comprises at least one of:
first diagnostics data representative of results of static code analysis performed on the existing computer code;
second diagnostics data representative of results of a compilation process associated with the existing computer code; or
third diagnostics data representative of results from tests executed on the existing computer code.

### Claim 9 (depends on 5)

The method of claim 5, further comprising, prior to generating the patched computer code:
generating first data representative of changes in the patched computer code with respect to the previous computer code; and
sending the first data to a device associated with the trigger event, the first data causing an integrated development environment (IDE) extension to display the changes in the patched computer code on the device.

### Claim 10 (depends on 9)

The method of claim 9, 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 11 (depends on 5)

The method of claim 5, 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 previous computer code in the computer code generation session; and
patching the previous computer code utilizing the hunks and based at least in part on the patching instructions, wherein patching the previous computer code utilizing the hunks comprises:
patching a first portion of the previous computer code utilizing the first hunks; and
patching a second portion of the previous computer code utilizing the second hunks after patching the first portion of the previous computer code.

### Claim 12 (depends on 5)

The method of claim 5, wherein the patched computer code is associated with elements of a GUI.

### Claim 13

One or more non-transitory computer-readable media storing instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising:
receiving first data indicating that a trigger event has occurred, the trigger event indicating that initiation of generation of patched computer code in a computer code generation session is to occur;
selecting, based at least in part on attributes of the trigger event, a code generation agent to generate the patched computer code;
identifying, based at least in part on attributes of the trigger event, existing computer code associated with a device associated with the trigger event;
receiving new computer code generated based at least in part on the existing computer code;
generating diagnostics data indicative of errors in the existing computer code based at least in part on a diagnostics component associated with the selected code generation agent processing the existing computer code and the new computer code;
generating filtered diagnostics data indicating types of the errors indicated by the diagnostics data;
generating, utilizing a large language model (LLM), hunks indicative of the errors in the existing computer code, 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; and
patching the existing computer code utilizing the hunks such that the patched computer code is generated in the computer code generation session.

### Claim 14 (depends on 13)

The one or more non-transitory computer readable media of claim 13, the operations further comprising:
generating, by a context indexing component, indexed context information associated with the computer code generation session;
storing the indexed context information in a database, the database configured to be queried by the code generation agent to generate the patched computer code;
retrieving, based at least in part on the code generation agent that was selected querying the database, the indexed context information associated with the computer code generation session; and
wherein generating the patched computer code in the computer code generation session is further based at least in part on the selected code generation agent querying the database.

### Claim 15 (depends on 14)

The one or more non-transitory computer readable media of claim 14, wherein the indexed context information includes at least one of:
project data associated with the computer code generation session, the project data comprising at least one of the existing computer code associated with a user account, text data associated with the user account, file structure data associated with the user account, open file information associated with the user account, or project documentation associated with the computer code generation session;
environmental data associated with the computer code generation session, the environmental data comprising at least library information indicating one or more libraries installed on a user device associated with the user account, operating system information indicating details of an operating system utilized by the user account, and database information indicating details of one or more databases utilized by the user account;
synthetic information associated with the project data, the synthetic information being based at least in part on information extracted from the existing computer code; or
indexed external data including at least external documents that are not specific to the user account, languages and frameworks specifications, security vulnerability database information, and related public documents.

### Claim 16 (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 previous computer code; and
sending the first data to a device associated with the trigger event, the first data causing an integrated development environment (IDE) extension to display the changes in the patched computer code on the device.

### Claim 17 (depends on 16)

The one or more non-transitory computer readable media of claim 16, 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 18 (depends on 13)

The one or more non-transitory computer readable media of claim 13, 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 19 (depends on 13)

The one or more non-transitory computer readable media of claim 13, 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 previous computer code in the computer code generation session; and
patching the previous computer code utilizing the hunks and based at least in part on the patching instructions, wherein patching the previous computer code utilizing the hunks comprises:
patching a first portion of the previous computer code utilizing the first hunks; and
patching a second portion of the previous computer code utilizing the second hunks after patching the first portion of the previous computer code.

### Claim 20 (depends on 13)

The one or more non-transitory computer readable media of claim 13, wherein the patched computer code is associated with elements of a GUI.
