The best feedback during a code review is specific, consistent, and understands the history of a project.
However, AI code review agents today are often stateless; they have no memory of past interactions. This means you might find the same feedback on new pull requests that you’ve rejected before, because the agent can’t learn from your team’s guidance, leading to frustration and repeated work.
Today, we’re releasing a new memory capability for Gemini Code Assist on GitHub for both enterprises and individual developers. Now, you can create a dynamic, evolving memory of your team’s coding standards, style, and best practices, all derived from your direct interactions and feedback within pull requests. The memory is stored securely in a Google-managed project specific to your installation, isolating it from other users.
Here’s how memory works
Memory transforms the code review agent from a stateless tool into a long-term project contributor that learns and adapts to your team.
Automated vs. manual memory
Gemini Code Assist on GitHub already supports memory in the form of styleguide.md files. These rules are always added to the agent’s prompt, which makes it suitable for static, universal guidelines.
In contrast, persistent memory introduces a more dynamic and automated approach. It automatically extracts rules from pull request interactions, requiring no manual effort. These learned rules are stored efficiently and are only retrieved and applied when they are relevant to the specific code being reviewed. This creates a smarter, more scalable memory that adapts to your team
The process is built on three key pillars:
1. It learns from your interactions
The process begins when you and your team do what you already do today – conducting code reviews: When a pull request is merged, Gemini Code Assist on GitHub will analyze the comment threads for feedback. For instance, if Gemini Code Assist on GitHub points out that “do not line-wrap import statements” in a .java file, and the author disagrees in their comment, the agent sees this interaction as a valuable piece of feedback and will store it. By waiting until a PR is merged, we ensure the conversation is complete and the code is a valuable source of truth.
2. It intelligently creates, updates and stores rules
From that simple interaction, persistent memory uses the powerful Gemini model to infer a generalized, reusable rule. In the example above, it would generate a natural language rule like: “In Java, import statements could be line-wrapped”.
3. It applies rules to future reviews
Source Credit: https://cloud.google.com/blog/products/ai-machine-learning/memory-for-ai-code-reviews-using-gemini-code-assist/
