Skip to content

InMemoryMemoryService search doesn't work with non-Latin text (Japanese, CJK, etc.) #5501

Closed

Description

@yodeee9

I was building a demo with InMemoryMemoryService and noticed that search_memory returns nothing when the conversation is in Japanese.

After digging in, the cause is _extract_words_lower in in_memory_memory_service.py:

return set([word.lower() for word in re.findall(r'[A-Za-z]+', text)])

This regex only matches ASCII letters, so any Japanese/Chinese/Korean/Cyrillic text gets completely dropped. For example:

_extract_words_lower("私の名前は太郎です")  # returns set()
_extract_words_lower("太郎 works at ABC")   # returns {'works', 'at', 'abc'} — 太郎 is lost

This means if you store a session in Japanese and then search for it, you'll never get a match.

A simple fix would be changing [A-Za-z]+ to \w+ with re.UNICODE, which matches word characters across all scripts.

ADK 1.31.1, Python 3.11

Activity

  1. added
    services
    on Apr 27, 2026
  2. added theissue type on Apr 27, 2026
  3. added 2 commits that reference this issue on Apr 27, 2026
    d940392
    fbe87e5
  4. llalitkumarrr commented on Apr 28, 2026

    @llalitkumarrr
    Collaborator

    Hello @yodeee9 ,

    Thank you for your contribution. Your PR is currently being reviewed. It will be merged once all checks pass and a reviewer approves it. Please keep an eye on the PR in case the reviewers leave any comments or feedback.

  5. added
    needs review
    on Apr 28, 2026
  6. removed
    needs review
    on May 8, 2026
  7. llalitkumarrr commented on May 8, 2026

    @llalitkumarrr
    Collaborator

    Hello @yodeee9 ,

    Could you please check if this issue still occurs in the newer version? Please test it using google-adk==1.32.0. If the problem persists, please share your complete code so we can reproduce and investigate it further. Thank you.

  8. added
    request clarification
    on May 8, 2026
  9. adk-bot commented on May 27, 2026

    @adk-bot
    Collaborator

    This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.

  10. added
    stale
    on May 27, 2026
  11. adk-bot commented on Jun 3, 2026

    @adk-bot
    Collaborator

    This has been automatically closed because it has been marked as stale for over 7 days.

  12. added a commit that references this issue on Jun 12, 2026
    be1425b
  13. added a commit that references this issue on Aug 11, 2026
    2053a69
  14. added a commit that references this issue on Aug 17, 2026
    b8ea1e8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

request clarificationservicesstale

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions