-
Notifications
You must be signed in to change notification settings - Fork 256
feat: Add ReasoningBank for reusable reasoning strategies #702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @nebrass, 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 the foundational ReasoningBank feature, designed to enhance agent capabilities by allowing them to learn from and reuse successful problem-solving approaches. By providing mechanisms to store and retrieve distilled reasoning strategies and raw execution traces, agents can apply proven methods to new, similar tasks, thereby improving their efficiency and effectiveness. The implementation includes core data models, a service interface with an in-memory prototype, and seamless integration into the existing tool and invocation contexts. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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
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 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
|
e874b9e to
37a1f5c
Compare
There was a problem hiding this 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 ReasoningBank feature, which is a significant and well-implemented addition. The new components, including data models, services, and tool integrations, are clearly defined and follow the existing architectural patterns of the project. The code is well-documented and accompanied by a comprehensive set of unit tests, ensuring the new functionality is robust. I have a couple of minor suggestions for code refinement in the InMemoryReasoningBankService to improve conciseness and use more idiomatic Java constructs, but overall, this is excellent work.
core/src/main/java/com/google/adk/reasoning/InMemoryReasoningBankService.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/google/adk/reasoning/InMemoryReasoningBankService.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/google/adk/reasoning/InMemoryReasoningBankService.java
Show resolved
Hide resolved
Implements ReasoningBank feature based on arXiv:2509.25140 paper. Core components: - ReasoningStrategy: distilled, reusable reasoning approach - ReasoningTrace: captures raw task execution data - BaseReasoningBankService: interface for storage/retrieval - InMemoryReasoningBankService: in-memory implementation with keyword matching - LoadReasoningStrategyTool: tool for agents to retrieve relevant strategies - SearchReasoningResponse: response model for strategy search Integration: - Added reasoningBankService to InvocationContext - Added searchReasoningStrategies() to ToolContext Includes 20 unit tests covering data models and service functionality.
37a1f5c to
c29b9c6
Compare
Summary
This PR implements the ReasoningBank feature based on the paper "Reasoning-Bank: Learning from the Traces of Thought" (arXiv:2509.25140).
What is ReasoningBank?
ReasoningBank enables agents to store and retrieve proven reasoning strategies, allowing them to learn from past successful task executions and apply those approaches to new, similar problems.
Components Added
Data Models (
com.google.adk.reasoning):ReasoningStrategy- Immutable model representing a distilled reasoning approach with problem pattern, steps, and tagsReasoningTrace- Captures raw task execution data (task, output, reasoning steps)SearchReasoningResponse- Response model for strategy searchService Layer:
BaseReasoningBankService- Interface defining store and search operationsInMemoryReasoningBankService- In-memory implementation using keyword matching with weighted scoringTool Integration (
com.google.adk.tools):LoadReasoningStrategyTool- Function tool enabling agents to search and load relevant strategiesLoadReasoningStrategyResponse- Tool response recordContext Integration:
reasoningBankServicefield toInvocationContextsearchReasoningStrategies()method toToolContextUsage Example
Test Plan
ReasoningStrategy(5 tests)ReasoningTrace(5 tests)InMemoryReasoningBankService(10 tests)Related
BaseMemoryService,InMemoryMemoryService,LoadMemoryTool)