-
Notifications
You must be signed in to change notification settings - Fork 26
Refactor OpenMemory Sample to Use get_fast_api_app with URI Scheme
#27
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
Conversation
Summary of ChangesHello @rakshith-git, 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 refactors the Highlights
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.
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 is a great refactoring of the OpenMemory sample. Using get_fast_api_app with a custom URI scheme simplifies the code significantly and aligns it with ADK best practices. The new structure is cleaner and more maintainable. The updated agent instructions are also a welcome improvement. I have one suggestion regarding the CORS configuration for improved security.
|
Please address or close Gemini Reviews before merge. |
I have addressed the issues |
Refactor OpenMemoryService Samples and readme to Use
get_fast_api_appwith URI SchemeSummary
This PR refactors the
open_memorysample to useget_fast_api_appwith theopenmemory://URI scheme instead of directly instantiatingAdkWebServer. The previous sample code was confusing and didn't work properly with ADK's standard patterns. The new implementation is cleaner, more maintainable, and works correctly with bothRunnerand the web UI.Changes
Improvements
get_fast_api_appwhich is the recommended way to set up ADK FastAPI serversopenmemory://URI scheme pattern consistent with other ADK services (e.g.,rag://,agentengine://)open_memory_agent/subdirectory following ADK's agent loading conventionsmain.py, removing the need for a separate registration fileWhat Works Now
✅ Works with
get_fast_api_appand web UI✅ Works with
Runnerfor programmatic usage✅ Proper service registration via URI scheme
✅ Clear, maintainable code structure
✅ Comprehensive documentation
Files Changed
contributing/samples/open_memory/main.py- Refactored to useget_fast_api_appwith URI schemecontributing/samples/open_memory/README.md- Updated with clear usage instructionscontributing/samples/open_memory/open_memory_agent/- Proper agent subdirectory structureTesting
The sample can be run with:
The server will start on
http://0.0.0.0:8000with the web UI enabled and memory working.