Skip to content

VertexAiRagMemoryService search_memory does not filter by user_id, causing memory leakage across users #1019

Closed

Description

@sqave

Issue description

When using VertexAiRagMemoryService, memory entries retrieved via search_memory are not filtered by user_id, only by session_id. This can result in memory being shared or leaked between different users if session IDs are reused or not globally unique.

In my application, I stored information under a session for user_id = "uid1". Later, when querying from a session with user_id = "uid2" and a different session ID, the same information was still retrieved, suggesting memory is not correctly scoped by user.

Expected behavior:

Memory entries should be filtered, preferably on the server side, by at least the user_id to ensure proper isolation between users.

Possible fix:

Uncomment this line.

if not context.source_display_name.startswith(f"{app_name}.{user_id}."):
     continue

Activity

  1. added
    services
    on May 29, 2025
  2. added theissue type on May 29, 2025
  3. changed the issue type fromtoon May 29, 2025
  4. added this to the FixIt Week milestone on May 29, 2025
  5. DeanChensj commented on May 29, 2025

    @DeanChensj
    Collaborator

    Thanks for reporting this issue. This is a temporary workaround, we will add server side filtering later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

services

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions