Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(memory): implement memory scoring and feedback system#83

Merged
m-mizutani merged 5 commits intomainfrom
feat/agent-memory-scoring
Nov 16, 2025
Merged

feat(memory): implement memory scoring and feedback system#83
m-mizutani merged 5 commits intomainfrom
feat/agent-memory-scoring

Conversation

@m-mizutani
Copy link
Contributor

No description provided.

… memory usefulness evaluation and management
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @m-mizutani, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces an experimental, intelligent memory management system for agents. The core idea is to make agent memories more adaptive and efficient by assigning a quality score to each memory, dynamically re-ranking them during retrieval based on their quality and recency, and automatically pruning outdated or unhelpful ones. This system leverages LLM-based feedback to continuously learn and refine memory scores, ultimately enhancing the agent's performance and decision-making over time.

Highlights

  • Agent Memory Scoring: Introduced a quality scoring system for agent memories, ranging from -10 (harmful) to +10 (helpful), to dynamically evaluate their usefulness.
  • Adaptive Memory Search: Implemented an adaptive search mechanism that re-ranks memories based on a weighted combination of similarity (50%), quality (30%), and recency (20%), improving the relevance of retrieved memories.
  • LLM-based Feedback System: Developed an LLM-based feedback collection system that automatically evaluates the usefulness of memories after each agent execution, updating their quality scores.
  • Conservative Memory Pruning: Added conservative pruning rules to automatically delete memories that are critically low-scoring, harmful and unused for extended periods, or moderately harmful and very old, ensuring memory efficiency.
  • Configurability and Backward Compatibility: The entire memory scoring and feedback system is highly configurable with default parameters optimized for gradual learning, and it maintains backward compatibility with existing memories.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive and well-designed memory scoring and feedback system. The implementation is robust, featuring a configurable scoring model, LLM-based feedback generation, EMA for score updates, and a sophisticated re-ranking and pruning mechanism. The code is well-structured, with new logic cleanly separated and extensive tests provided. My review comments focus on minor improvements to test robustness, code organization, and configuration validation to further enhance the maintainability of this excellent new feature.

…ntation for better session behavior in BigQuery agent tests
…re function and remove redundant tests for score calculation
@m-mizutani m-mizutani merged commit 0f0b48a into main Nov 16, 2025
5 checks passed
@m-mizutani m-mizutani deleted the feat/agent-memory-scoring branch November 16, 2025 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments