An AI intelligent code review system and a review method
By introducing an AI model invocation module into the code review system, the code review system and AI IDE are integrated, automatically processing review comments and submitting modifications. This solves the problems of insufficient user experience and data connectivity in existing technologies, and improves R&D efficiency and convenience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING SIMPLE POINT TECH CO LTD
- Filing Date
- 2026-04-27
- Publication Date
- 2026-07-21
AI Technical Summary
In existing technologies, when AI IDEs generate code and submit it to the code review system, there are shortcomings in the user experience and data connectivity, resulting in low R&D efficiency.
By introducing an AI model invocation module into the traditional code review system, a closed-loop system is built. The AI model automatically processes review comments and submits the modified results back to the development branch, realizing the integration of the code review system with the AI IDE, and supporting the batch merging of multiple review comments and automatic linkage updates.
It improves the convenience and efficiency of code review, reduces the need for engineers to switch between local IDEs, ensures codebase consistency, and improves the efficiency of team collaborative development.
Smart Images

Figure FT_1 
Figure FT_2
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to an AI-powered intelligent code review system and method. Background Technology
[0002] In modern software development, code review systems are a crucial core system of code hosting platforms and an important vehicle for collaborative code development among teams. A common scenario is as follows: After a development engineer completes the code using their personal development tool (usually an IDE), they submit it to the development branch on the code server. After self-testing, they initiate a code review to merge it into the main branch. Colleagues provide review suggestions during the code review process. If the review passes, the code can be merged into the main branch. If it fails, the development engineer continues to modify the code and submit it to the development branch, updating the code review until it passes. Currently, code review systems are usually a subsystem of code hosting platforms, serving as a common function for collaborative code development within teams. Examples include well-known international platforms like GitHub (primarily positioned for collaborative development within an open-source developer community) and GitLab (primarily positioned for collaborative development in enterprise scenarios). Domestic vendors have also launched many similar products based on the open-source version of GitLab.
[0003] Meanwhile, with the development of AI technology, automatic code generation technology has matured and is widely used in engineers' personal development tools. In the past two years, the industry has launched various AI IDEs, such as Cursor and Claude Code from abroad, and ByteDance Trae, Alibaba Tongyi Lingma, Baidu Comate, Tencent CodeBuddy, and iFlyCode from China.
[0004] In summary, the current mainstream development model in the industry is for development engineers to efficiently generate code using AI IDEs, submit it to development branches, and then initiate code reviews on the main branch for multi-person collaborative development. Currently, the model where development engineers efficiently generate code using AI IDEs, submit it to development branches, and then initiate code reviews on the main branch for collaborative team development has significantly improved development efficiency compared to traditional development models, thanks to the support of AI capabilities. However, the code review system and the AI IDE are two separate systems. The AI IDE is a tool for individual engineers to develop intelligent code, while the code review system, as a subsystem of the code hosting platform, is a platform for team collaboration. For example, engineers need to log in to the code review system to view code review comments, and then modify the code based on the comments, either individually or with the help of the AI capabilities of the AI IDE, before undergoing another code review. This process is inconvenient and inefficient in terms of both user experience and data connectivity. Summary of the Invention
[0005] The purpose of this invention is to provide an AI-powered intelligent code review system and method. By leveraging AI capabilities, this system addresses the disconnect between the data and user experience of AI IDEs used by engineers for individual code development and code review systems. The code review system can automatically update code based on review suggestions using AI capabilities, thereby improving development efficiency and user experience.
[0006] The key technical points and protection points of this invention are as follows: 1. Integration architecture of AI model invocation module and traditional code review system Based on the traditional code review system (which includes code review form management and review comment recording functions), an AI model invocation module has been added. This module works in collaboration with the code management subsystem and the large model platform to form a closed-loop system architecture of "code review comment input → artificial intelligence model processing → automatic submission of modified code → automatic update of review form". The key technical point is that the AI model invocation module reads the review comment data from the traditional code review system and the code file content from the code management subsystem, constructs complete context prompts, and writes the modification results returned by the large model platform back to the development branch through the code management subsystem interface. The entire process does not require engineers to leave the code review system and switch to the local development environment.
[0007] 2. A method for constructing structured prompts based on code review comments The code review comments, the corresponding code file path and line number, the context of the differences in that line of code (code snippets before and after the change), and the complete code file content pulled from the code management subsystem are combined according to a preset template into prompts sent to the large model platform. This enables the large model platform to accurately understand "where, what to change, and how to change", thereby improving the accuracy of code modifications.
[0008] 3. Batch merging and atomic submission method for multiple review comments For scenarios where there are multiple review comments in the same code review form, the review comments are grouped according to the code files involved. Multiple review comments for the same file are merged into a single large model call for processing. The modification results of all files are pushed to the development branch in a single atomic commit (that is, all modifications are packaged into a single code commit record), avoiding code conflicts caused by multiple commits and ensuring that the code repository is in a consistent and usable state at any time.
[0009] 4. Automatic linkage and update mechanism between code review forms and development branches After the AI model calling module pushes the modified code to the development branch, the code review system automatically detects the update of the development branch and refreshes the code difference view in the code review form; at the same time, it updates the status of the review comments to "processed by artificial intelligence" and automatically appends the artificial intelligence processing record (including processing time and modification summary generated by the large model) below the review comments, allowing reviewers to trace the source and content of each artificial intelligence modification.
[0010] 5. Methods for AI to proactively identify code issues and generate review comments. After a code review form is created, the system automatically extracts the code differences from the current change, calls the large model platform to analyze them from dimensions such as code style, potential defects, performance optimization, and security risks, and automatically writes the structured review comments (including file path, line number, problem description and modification suggestions) returned by the large model platform into the corresponding code line of the code review form, and marks the reviewer as "AI automatic reviewer" for human reviewers to refer to or directly trigger the automatic repair process.
[0011] To achieve the above objectives, the present invention provides the following technical solution: An AI-powered intelligent code review system and method are disclosed, comprising a traditional code review system and an AI model invocation module. The traditional code review system is used to create code reviews for merging code between different branches of a code repository and to record and manage review comments. The AI model invocation module is used to invoke a large model platform to modify the code based on the code review comments and the code.
[0012] As a further aspect of the present invention: the traditional code review system is a subsystem of the code hosting platform.
[0013] As a further aspect of the present invention, the traditional code review system needs to work in conjunction with the code management system subsystem in the code hosting platform.
[0014] As a further aspect of the present invention: the AI model calling module simultaneously reads the review comments data from the traditional code review system and the code file content from the code management subsystem, constructs complete contextual prompts, and writes the modification results returned by the large model platform back to the development branch through the code management subsystem interface.
[0015] As a further embodiment of the present invention, its method steps are as follows: Step 1: The development engineer uses a local IDE to write code. After the code is written, it is submitted to the development branch of the code hosting platform. Step 2: Merge the code from the development branch to the target branch and create a code review form; Step 3: Colleagues review the code changes through the code review system and provide review suggestions; Step 4: The code review system uses the code review suggestions generated in Step 3 as prompts, and issues instructions through the AI model to complete the code modification. The modified code is then submitted back to the development branch, and the code review form is automatically updated. Step 5: Repeat steps 3 and 4 until the code is modified to your satisfaction and merged into the target branch.
[0016] As a further aspect of the present invention: Steps one, two, and three are exactly the same as the traditional code development and code review process.
[0017] As a further aspect of the present invention: the local IDE is a regular IDE.
[0018] As a further aspect of the present invention: the local IDE is AIIDE.
[0019] As a further aspect of the present invention, the target branch includes, but is not limited to, the trunk branch.
[0020] Compared with the prior art, the beneficial effects of the present invention are: User-friendly and efficient: Users no longer need to repeatedly switch to their local IDE to develop code based on review suggestions, modify it, and resubmit it during the code review process. The entire process of code review and automatic code modification based on review suggestions using AI capabilities is completed in a closed loop within the code review system, making it more convenient and efficient. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the structure and process of an AI-powered intelligent code review system and review method.
[0022] Figure 2 A schematic diagram illustrating the steps of an AI-powered intelligent code review method. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] Please see Figure 1-2 In this embodiment of the invention, an AI-powered intelligent code review system includes a traditional code review system and an AI model invocation module. The traditional code review system is used to create code reviews for merging code between different branches of a code repository, record and manage review comments, etc. The AI model invocation module is used to invoke a large model platform to modify the code based on the code review comments and the code. The traditional code review system is a subsystem of the code hosting platform, and the traditional code review system needs to work collaboratively with the code management system subsystem in the code hosting platform. An AI-powered intelligent code review method, the steps of which are as follows: Step 1: The development engineer uses a local IDE (either a regular IDE or an AI IDE) to write code. After the code is written, it is submitted to the development branch of the code hosting platform, as shown by arrow 1. Step 2: Merge the code from the development branch to the target branch (e.g., the trunk branch) and create a code review form, as shown by arrow 2; Step 3: Colleagues review the code changes through the code review system and provide review suggestions, as shown by arrow 3; Step 4: The code review system uses the code review suggestions generated in Step 3 as prompts, and issues instructions through the AI model to complete the code modification. The modified code is then submitted back to the development branch, as shown by arrow 4. This is a basic function of a traditional code review system. At this time, the code review form will be automatically updated. Step 5: Repeat steps 3 and 4 until the code is modified to your satisfaction and merged into the target branch.
[0025] Steps one, two, and three are exactly the same as the traditional code development and code review process.
[0026] Taking a company's self-developed code hosting platform as an example, this platform includes a self-developed code server and traditional code review modules, and integrates artificial intelligence large language model capabilities to achieve intelligent code review. The specific implementation steps are as follows: Step 1: Review Comments Collection and Structure. When reviewers submit review comments on a specific line of code change (difference line) in the code review system, the system automatically records the following information: the text content of the review comment, the corresponding file path and line number, the code difference context to which the line belongs (including the code snippets before and after the change), and the unique identifier (identifier) of the code review form. This information will be encapsulated into a structured review comment object and stored in the database as input data for subsequent use by artificial intelligence models.
[0027] Step Two: Prompt Word (AI Model Input Command) Construction. The system retrieves the complete code content of the corresponding file from the development branch in the code management subsystem. Combining this with the review comments and code difference context collected in Step One, it assembles the prompt word according to a preset template. An example prompt word template is as follows: "The following is a code file content: [Code Content]. The code reviewer has given the following modification suggestion for line [line number]: [Review Comment Text]. Please modify the code according to the above suggestion, outputting only the complete modified code file content, without any explanation." Step 3: Call the large model platform to complete the code modification. The AI model calling module sends the prompt words constructed in Step 2 to the large model platform (such as a privately deployed large model service or an authorized third-party large model application interface) via the Hypertext Transfer Protocol Secure (HTTP) (i.e., a network request interface). After receiving the request, the large model platform understands and modifies the code according to the prompt words, and returns the modified complete code file to the AI model calling module.
[0028] Step 4: Submit the modified code back to the development branch. After receiving the modified code from the large model platform, the AI model invocation module pushes the modified file content as a new commit (code change record) to the corresponding development branch through the interface provided by the code management subsystem (such as based on the version control system interface). The commit information (version change description) is automatically generated, with the following format example: "[AI Auto-Fix] Automatically modified [filename] based on review comments, original review comments: [Review Comment Text]".
[0029] Step 5: Automatic Updates to the Code Review Form. After a new commit is pushed to the development branch, the code review system detects the update and automatically refreshes the code difference view in the code review form, displaying the latest code changes. Reviewers can directly view the latest code modified by AI within the code review system and decide whether to provide further review comments or approve the code review.
[0030] In real-world code review scenarios, reviewers often provide multiple comments on multiple files and lines of code within the same review form. Processing each comment individually using an AI model is inefficient and could lead to merge conflicts between multiple code commits.
[0031] This embodiment describes the specific implementation of batch processing: When a development engineer clicks the "AI One-Click Repair" button in the code review system, the system collects all unprocessed review comments under the current code review form and groups them according to the files involved. For each file, all relevant review comments for that file are merged into the same prompt word and sent to the large model platform for processing at once. The large model platform returns the complete modified content of the file. The system maintains a set of file modifications in memory. After summarizing the modification results of all files, it pushes them to the development branch through the code management subsystem interface in a single atomic commit (that is, packaging all file modifications into a single commit record), avoiding intermediate code commits and reducing the risk of merge conflicts. After the commit is completed, the code review form is automatically updated, and the status of all processed review comments is marked as "processed by AI".
[0032] Based on Embodiment 1 and Embodiment 2, this system can also be extended to realize the function of artificial intelligence proactively discovering code problems and generating review comments.
[0033] The specific implementation is as follows: When a development engineer creates a code review form, the system automatically triggers the AI-powered automated review process. The system extracts all code differences involved in the code review form, constructs prompts by file, and requests the large model platform to analyze the code changes from dimensions such as code style, potential defects (program errors), performance optimization, and security risks, and returns review comments in a structured format (including file path, line number, problem description, and modification suggestions). After receiving the structured review comments returned by the large model platform, the system automatically creates a review comment entry on the corresponding line of code in the code review form, labeled by the reviewer as "AI-powered automated review." After reviewing these AI-generated review comments, the development engineer can trigger the automated repair process described in Example 1 or Example 2 with one click, realizing a complete AI closed loop from problem discovery to problem repair.
[0034] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An AI intelligent code review system, comprising a traditional code review system and an AI model calling module, characterized in that: The traditional code review system is used to create code reviews for merging code between different branches of the code repository and to record and manage review comments. The AI model calling module is used to call a large model platform to modify the code based on the code review comments and the code. 2.The AI intelligent code review system according to claim 1, characterized in that: The traditional code review system is a subsystem of the code hosting platform.
3. The AI-powered intelligent code review system according to claim 1, characterized in that: The traditional code review system needs to work in conjunction with the code management system subsystem in the code hosting platform.
4. The AI-powered intelligent code review system according to claim 1, characterized in that: The AI model calling module simultaneously reads the review comments data from the traditional code review system and the code file content from the code management subsystem, constructs complete context prompts, and writes the modification results returned by the large model platform back to the development branch through the code management subsystem interface.
5. The AI-powered intelligent code review method according to claim 1, characterized in that: The method and steps are as follows: Step 1: The development engineer uses a local IDE to write code. After the code is written, it is submitted to the development branch of the code hosting platform. Step 2: Merge the code from the development branch to the target branch and create a code review form; Step 3: Colleagues review the code changes through the code review system and provide review suggestions; Step 4: The code review system uses the code review suggestions generated in Step 3 as prompts, and issues instructions through the AI model to complete the code modification. The modified code is then submitted back to the development branch, and the code review form is automatically updated. Step 5: Repeat steps 3 and 4 until the code is modified to your satisfaction and merged into the target branch.
6. The AI-powered intelligent code review method according to claim 5, characterized in that: Steps one, two, and three are exactly the same as the traditional code development and code review process.
7. The AI-powered intelligent code review method according to claim 6, characterized in that: The local IDE mentioned is a regular IDE.
8. The AI-powered intelligent code review method according to claim 6, characterized in that: The local IDE is AIIDE.
9. The AI-powered intelligent code review method according to claim 6, characterized in that: The target branch includes, but is not limited to, the trunk branch.