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

## 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;
determining attributes of the query, the attributes indicating how the computer code is to be generated;
determining, based at least in part on the attributes of the query, a subset of first embeddings generated from indexed context information, wherein the first embeddings represent at least 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, and project documentation associated with the computer code generation session;
determining, based at least in part on the attributes of the query, a subset of second embeddings generated from the existing computer code, wherein the second embeddings represent synthetic information generated based at least in part on information extracted from the existing computer code;
querying a vector database storing the first embeddings and the second embeddings; and
receiving, utilizing the vector database, files associated with the subset of the first embeddings and text portions associated with the subset of the second embeddings.

### Claim 2 (depends on 1)

The system of claim 1, the operations further comprising:
generating a search embedding of the query, the search embedding representing a vector of the query;
comparing the search embedding with embeddings in the vector database to determine which of the embeddings most closely correspond to the search embedding; and
wherein determining the subset of the first embeddings and the subset of the second embeddings is based at least in part on which of the embeddings most closely correspond to the search embedding.

### Claim 3 (depends on 1)

The system of claim 1, the operations further comprising:
determining a query type of the query; and
wherein determining the subset of the first embeddings and the subset of the second embeddings is based at least in part on the query type of the query.

### Claim 4 (depends on 1)

The system of claim 1, the operations further comprising:
determining a type of code generation agent selected to generate the computer code in response to the query; and
wherein determining the subset of the first embeddings and the subset of the second embeddings is based at least in part on the type of the code generation agent.

### Claim 5

A method comprising:
receiving a query for a computer code generation component to initiate generation of computer code in a computer code generation session;
determining attributes of the query, the attributes indicating how the computer code is to be generated;
determining, based at least in part on the attributes of the query, a subset of first embeddings generated from indexed context information, wherein the first embeddings represent at least one of 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; and
receiving, utilizing a vector database storing the first embeddings, files associated with the subset of the first embeddings.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
generating a search embedding of the query, the search embedding representing a vector of the query;
comparing the search embedding with embeddings in the vector database to determine which of the embeddings most closely correspond to the search embedding; and
wherein determining the subset of the first embeddings is based at least in part on which of the embeddings most closely correspond to the search embedding.

### Claim 7 (depends on 5)

The method of claim 5, further comprising:
determining a query type of the query; and
wherein determining the subset of the first embeddings is based at least in part on the query type of the query.

### Claim 8 (depends on 5)

The method of claim 5, further comprising:
determining a type of code generation agent selected to generate the computer code in response to the query; and
wherein determining the subset of the first embeddings is based at least in part on the type of the code generation agent.

### Claim 9 (depends on 5)

The method of claim 5, further comprising:
generating, by the context indexing component, indexed company data;
generating second embeddings from the indexed company data as processed by the context indexing component, wherein the second embeddings represent at least one of company documents, internal application programming interface documents, or custom files associated with the user account; and
storing the second embeddings in the vector database.

### Claim 10 (depends on 5)

The method of claim 5, further comprising:
determining, based at least in part on attributes of the query, a subset of second embeddings generated from at least indexed external data processed by the context indexing component, wherein the second embeddings represent at least external documents that are not specific to the user account, languages and frameworks specifications, security vulnerability database information, or related public documents; and
receiving, utilizing the vector database storing the second embeddings, additional files associated with the subset of the second embeddings.

### Claim 11 (depends on 5)

The method of claim 5, further comprising:
determining, based at least in part on attributes of the query, a subset of second embeddings generated from the existing computer code, wherein the second embeddings represent synthetic information generated based at least in part on information extracted from the existing computer code; and
receiving, utilizing the vector database storing the second embeddings, additional files associated with the subset of the second embeddings.

### Claim 12 (depends on 5)

The method of claim 5, further comprising:
generating a machine learning ensemble configured to utilize multiple machine learning techniques to determine which embeddings in the vector database are associated with the query;
providing the query as input to the machine learning ensemble; and
wherein determining the subset of the first embeddings is performed utilizing the machine learning ensemble.

### Claim 13

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 to initiate generation of computer code in a computer code generation session;
determining attributes of the query, the attributes indicating how the computer code is to be generated;
determining, based at least in part on the attributes of the query, a subset of first embeddings generated from indexed context information, wherein the first embeddings represent at least one of existing computer code associated with the 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; and
receiving, utilizing a vector database storing the first embeddings, files associated with the subset of the first embeddings.

### Claim 14 (depends on 13)

The system of claim 13, the operations further comprising:
generating a search embedding of the query, the search embedding representing a vector of the query;
comparing the search embedding with embeddings in the vector database to determine which of the embeddings most closely correspond to the search embedding; and
wherein determining the subset of the first embeddings is based at least in part on which of the embeddings most closely correspond to the search embedding.

### Claim 15 (depends on 13)

The system of claim 13, the operations further comprising:
determining a query type of the query; and
wherein determining the subset of the first embeddings is based at least in part on the query type of the query.

### Claim 16 (depends on 13)

The system of claim 13, the operations further comprising:
determining a type of code generation agent selected to generate the computer code in response to the query; and
wherein determining the subset of the first embeddings is based at least in part on the type of the code generation agent.

### Claim 17 (depends on 13)

The system of claim 13, the operations further comprising:
generating, by the context indexing component, indexed company data;
generating second embeddings from the indexed company data as processed by the context indexing component, wherein the second embeddings represent at least one of company documents, internal application programming interface documents, or custom files associated with the user account; and
storing the second embeddings in the vector database.

### Claim 18 (depends on 13)

The system of claim 13, the operations further comprising:
determining, based at least in part on attributes of the query, a subset of second embeddings generated from at least indexed external data processed by the context indexing component, wherein the second embeddings represent at least external documents that are not specific to the user account, languages and frameworks specifications, security vulnerability database information, or related public documents; and
receiving, utilizing the vector database storing the second embeddings, additional files associated with the subset of the second embeddings.

### Claim 19 (depends on 13)

The system of claim 13, the operations further comprising:
determining, based at least in part on attributes of the query, a subset of second embeddings generated from the existing computer code, wherein the second embeddings represent synthetic information generated based at least in part on information extracted from the existing computer code; and
receiving, utilizing the vector database storing the second embeddings, additional files associated with the subset of the second embeddings.

### Claim 20 (depends on 13)

The system of claim 13, the operations further comprising:
generating a machine learning ensemble configured to utilize multiple machine learning techniques to determine which embeddings in the vector database are associated with the query;
providing the query as input to the machine learning ensemble; and
wherein determining the subset of the first embeddings is performed utilizing the machine learning ensemble.
