# US 2026/0064389 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/0064389 A1
- Document ID: US20260064389A1
- Status: Published application
- Kind: A1
- Application number: 19/309,814
- 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/US20260064389A1

## 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 a query for a computer code generation component of the system to initiate generation of computer code in a computer code generation session;
querying a first database for a subset of first embeddings generated from indexed context information processed by a context indexing component, the indexed context information being associated with existing computer code specific to a user account associated with the query;
retrieving, based at least in part on querying the first database, first files associated with the indexed context information; and
filtering, utilizing a large language model (LLM), the first files such that filtered results data is generated, the filtered results data including filtered computer code.

### Claim 2 (depends on 1)

The system of claim 1, the operations further comprising:
querying one or more second databases for one or more subsets of second embeddings generated from at least one of:
indexed external data processed by the context indexing component, the indexed external data being unspecific to the user account; or
indexed company data processed by the context indexing component, the indexed company data being specific to an organization associated with the user account;
retrieving, based at least in part on querying the one or more second databases, one or more second files associated with at least one of the indexed external data or the indexed company data;
filtering the first files and the one or more second files utilizing the LLM such that the filtered results data is generated, wherein the filtered results data further includes at least one of filtered external data, filtered context files, or filtered company data;
ranking, utilizing the LLM, the filtered results data; and
merging the existing computer code, and at least one of the external data, context files, or the company data such that the existing computer code, the external data, the context files, and the company data represent a unified dataset based at least in part on the ranking.

### Claim 3 (depends on 1)

The system of claim 1, the operations further comprising:
generating input data from the filtered results data, the input data configured to be input into the LLM;
inputting the input data to the LLM along with a prompt requesting a reranking of the filtered results data; and
receiving output data from the LLM, the output data representing a reranking of the filtered results data, the reranking differing at least in part from a ranking of the filtered results data prior to generating the input data.

### Claim 4 (depends on 1)

The system of claim 1, the operations further comprising:
generating input data from the filtered results data, the input data configured to be input into the LLM;
inputting the input data to the LLM along with a prompt requesting a weighting of the filtered results data; and
receiving output data from the LLM, the output data representing individual weightings of individual portions of the filtered results data.

### Claim 5 (depends on 1)

The system of claim 1, the operations further comprising:
prior to querying the first database, selecting a code generation agent from multiple code generation agents to generate the computer code, the selecting based at least in part on the query;
receiving a request from the code generation agent for the filtered results data, wherein generating the filtered results data is performed based at least in part on receiving the request; and
generating a response to the request based at least in part on generating the filtered results data.

### Claim 6 (depends on 1)

The system of claim 1, the operations further comprising:
determining a subject matter of the query to generate the computer code;
inputting the filtered results data to the LLM along with a prompt requesting a reranking of the filtered results data based at least in part on the subject matter of the query; and
receiving output data from the LLM, the output data representing a reranking of the filtered results data based at least in part on the subject matter of the query.

### Claim 7

A method comprising:
receiving a query for a computer code generation component to initiate generation of computer code in a computer code generation session;
querying one or more databases for a subset of first embeddings generated from indexed context information associated with existing computer code;
retrieving, based at least in part on querying the one or more databases, first files associated with the indexed context information; and
filtering, utilizing a large language model (LLM), the first files such that filtered results data is generated, the filtered results data including filtered computer code.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
querying the one or more databases for one or more subsets of second embeddings generated from at least one of:
indexed external data processed by the context indexing component, the indexed external data being unspecific to the user account; or
indexed company data processed by the context indexing component, the indexed company data being specific to an organization associated with the user account;
retrieving, based at least in part on querying the one or more databases, one or more second files associated with at least one of the indexed external data or the indexed company data;
filtering the first files and the one or more second files utilizing the LLM such that the filtered results data is generated, wherein the filtered results data further includes at least one of filtered external data, filtered context files, or filtered company data;
ranking, utilizing the LLM, the filtered results data; and
merging the existing computer code, the external data, context files, and the company data such that the external data, the context files, and the company data represent a unified dataset based at least in part on the ranking.

### Claim 9 (depends on 7)

The method of claim 7, further comprising:
generating input data from the filtered results data, the input data configured to be input into the LLM;
inputting the input data to the LLM along with a prompt requesting a reranking of the filtered results data; and
receiving output data from the LLM, the output data representing a reranking of the filtered results data, the reranking differing at least in part from a ranking of the filtered results data prior to generating the input data.

### Claim 10 (depends on 7)

The method of claim 7, further comprising:
generating input data from the filtered results data, the input data configured to be input into the LLM;
inputting the input data to the LLM along with a prompt requesting a weighting of the filtered results data; and
receiving output data from the LLM, the output data representing individual weightings of the filtered results data.

### Claim 11 (depends on 7)

The method of claim 7, further comprising:
prior to querying the one or more databases, selecting a code generation agent from multiple code generation agents to generate the computer code, the selecting based at least in part on the query;
receiving a request from the code generation agent for the filtered results data, wherein generating the filtered results data is performed based at least in part on receiving the request; and
generating a response to the request based at least in part on generating the filtered results data.

### Claim 12 (depends on 7)

The method of claim 7, further comprising:
prior to querying the one or more databases, selecting a code generation agent from multiple code generation agents to generate the computer code, the selecting based at least in part on the query; and
ranking, utilizing the LLM, the filtered results data based at least in part on the code generation agent that is selected.

### Claim 13 (depends on 7)

The method of claim 7, further comprising:
determining a subject matter of the query to generate the computer code;
inputting the filtered results data to the LLM along with a prompt requesting a reranking of the filtered results data based at least in part on the subject matter of the query; and
receiving output data from the LLM, the output data representing a reranking of the filtered results data based at least in part on the subject matter of the query.

### Claim 14

One or more non-transitory computer-readable media storing instructions that, when executed by the one or more processors, cause one or more processors to perform operations comprising:
receiving a query for a computer code generation component to initiate generation of computer code in a computer code generation session;
querying one or more databases for a subset of first embeddings generated from indexed context information, the indexed context information being associated with existing computer code specific to the user account;
retrieving, based at least in part on querying the one or more databases, first files associated with the indexed context information; and
filtering, utilizing a large language model (LLM), the first files such that filtered results data is generated, the filtered results data including filtered computer code.

### Claim 15 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, the operations further comprising:
querying the one or more databases for one or more subsets of second embeddings generated from at least one of:
indexed external data processed by the context indexing component, the indexed external data being unspecific to the user account; or
indexed company data processed by the context indexing component, the indexed company data being specific to an organization associated with the user account;
retrieving, based at least in part on querying the one or more databases, one or more second files associated with at least one of the indexed external data or the indexed company data;
filtering the first files and the one or more second files utilizing the LLM such that the filtered results data is generated, wherein the filtered results data further includes at least one of filtered external data, filtered context files, or filtered company data;
ranking, utilizing the LLM, the filtered results data; and
merging the existing computer code, the external data, context files, and the company data such that the external data, the context files, and the company data represent a unified dataset based at least in part on the ranking.

### Claim 16 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, the operations further comprising:
generating input data from the filtered results data, the input data configured to be input into the LLM;
inputting the input data to the LLM along with a prompt requesting a reranking of the filtered results data; and
receiving output data from the LLM, the output data representing a reranking of the filtered results data, the reranking differing at least in part from a ranking of the filtered results data prior to generating the input data.

### Claim 17 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, the operations further comprising:
generating input data from the filtered results data, the input data configured to be input into the LLM;
inputting the input data to the LLM along with a prompt requesting a weighting of the filtered results data; and
receiving output data from the LLM, the output data representing individual weightings of the filtered results data.

### Claim 18 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, the operations further comprising:
prior to querying the one or more databases, selecting a code generation agent from multiple code generation agents to generate the computer code, the selecting based at least in part on the query;
receiving a request from the code generation agent for the filtered results data, wherein generating the filtered results data is performed based at least in part on receiving the request; and
generating a response to the request based at least in part on generating the filtered results data.

### Claim 19 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, the operations further comprising:
prior to querying the one or more databases, selecting a code generation agent from multiple code generation agents to generate the computer code, the selecting based at least in part on the query; and
ranking, utilizing the LLM, the filtered results data based at least in part on the code generation agent that is selected.

### Claim 20 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, the operations further comprising:
determining a subject matter of the query to generate the computer code;
inputting the filtered results data to the LLM along with a prompt requesting a reranking of the filtered results data based at least in part on the subject matter of the query; and
receiving output data from the LLM, the output data representing a reranking of the filtered results data based at least in part on the subject matter of the query.
