add goodmem save/fetch tools and chat plugin#49
add goodmem save/fetch tools and chat plugin#49forrestbao wants to merge 5 commits intogoogle:mainfrom
Conversation
Summary of ChangesHello @forrestbao, 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 significantly enhances the ADK's capabilities by integrating Goodmem.ai for persistent memory management. It provides agents with both explicit tools for saving and fetching information, and an automatic plugin for maintaining conversational context across interactions. This integration aims to improve the agent's ability to recall past information and provide more personalized and coherent responses. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and valuable integration with Goodmem.ai, adding both agent-invoked tools and an automatic chat memory plugin. The code is well-structured and includes comprehensive documentation and tests. However, there are a few critical issues that should be addressed before merging, primarily concerning code duplication, the use of a global variable for state which can cause race conditions, and performance concerns like an N+1 query pattern. I've also included several medium-severity suggestions to improve maintainability, dependency management, and robustness.
Consolidate the Goodmem client, add batch metadata retrieval, and align error handling and docs with review notes. Also update tests to cover lazy embedder resolution, batch fetch, and error paths.
Summary
|
Summary
Tests
|
forrestbao
left a comment
There was a problem hiding this comment.
Replied to each Gemini Code Assist comment with the applied fixes.
PR: Goodmem tools, plugin, and memory service for ADK
This PR adds Goodmem.ai integrations to ADK: two tools, one plugin for automatic chat memory in conversational agents, and one memory service.
Files added / changed (ASCII tree)
Legend:
A= added,M= modified.What’s included
Tools (agent-invoked)
goodmem_savegoodmem_fetchuser_id,session_id). Space is created or reused per user (adk_tool_{user_id}).Plugin (automatic, callbacks)
adk_chat_{user_id}).Memory Service (based on
BaseMemoryService)after_agent_callback(after each turn).preload_memory/load_memorytools.adk_memory_{app_name}_{user_id}).GoodmemClientfrom plugins (persistent HTTP connection, multipart binary upload).How to instantiate and wire to an ADK agent
Local development (including before they are merged into an official
google-adk-communityrelease):Tools: all arguments (including optional)
Plugin: all arguments (including optional)
Memory Service: all arguments (including optional)
Docs and demos