Scope Vertex RAG memory display names#5295
Closed
petrmarinec wants to merge 4 commits intogoogle:mainfrom
Closed
Conversation
Collaborator
|
Hi @petrmarinec , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Your PR has been received by the team and is currently under review. We will provide feedback as soon as we have an update to share. |
Collaborator
|
Hi @DeanChensj , can you please review this. |
DeanChensj
approved these changes
Apr 21, 2026
copybara-service Bot
pushed a commit
that referenced
this pull request
Apr 25, 2026
Merge #5295 ## Summary Fixes #5294. This PR tightens `VertexAiRagMemoryService` memory scoping by replacing the ambiguous dot-delimited RAG `display_name` format with an encoded v1 format for new uploads. Search results are now parsed into exact `app_name`, `user_id`, and `session_id` components before being accepted. The change also keeps compatibility for old unambiguous legacy display names in the exact `app.user.session` form, while ignoring ambiguous legacy names that contain extra dot-delimited components. ## Why The previous client-side filter used: ```python context.source_display_name.startswith(f"{app_name}.{user_id}.") ``` That can collide for IDs such as `alice` and `alice.smith`, allowing memory stored under `demo.alice.smith.*` to pass a lookup for `demo` / `alice`. ## Tests ```text PYTHONPATH=src python -m pytest tests/unittests/memory -q 42 passed, 2 warnings python -m isort --check-only src/google/adk/memory/vertex_ai_rag_memory_service.py tests/unittests/memory/test_vertex_ai_rag_memory_service.py passed python -m pyink --check --config pyproject.toml src/google/adk/memory/vertex_ai_rag_memory_service.py tests/unittests/memory/test_vertex_ai_rag_memory_service.py passed git diff --check -- src/google/adk/memory/vertex_ai_rag_memory_service.py tests/unittests/memory/test_vertex_ai_rag_memory_service.py passed ``` ## Checklist - [x] I have read the CONTRIBUTING.md document. - [x] I have performed a self-review of my own code. - [x] I have added tests that prove my fix is effective. - [x] New and existing unit tests pass locally with my changes. COPYBARA_INTEGRATE_REVIEW=#5295 from petrmarinec:fix/vertex-rag-memory-scope 64a8f5a PiperOrigin-RevId: 905365796
Collaborator
|
Thank you @petrmarinec for your contribution! 🎉 Your changes have been successfully imported and merged via Copybara in commit 784350d. Closing this PR as the changes are now in the main branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5294.
This PR tightens
VertexAiRagMemoryServicememory scoping by replacing the ambiguous dot-delimited RAGdisplay_nameformat with an encoded v1 format for new uploads. Search results are now parsed into exactapp_name,user_id, andsession_idcomponents before being accepted.The change also keeps compatibility for old unambiguous legacy display names in the exact
app.user.sessionform, while ignoring ambiguous legacy names that contain extra dot-delimited components.Why
The previous client-side filter used:
That can collide for IDs such as
aliceandalice.smith, allowing memory stored underdemo.alice.smith.*to pass a lookup fordemo/alice.Tests
Checklist