Skip to content

feat(memory): add RedisMemoryService#5919

Open
volkthienpreecha wants to merge 2 commits into
google:mainfrom
volkthienpreecha:codex/adk-redis-memory
Open

feat(memory): add RedisMemoryService#5919
volkthienpreecha wants to merge 2 commits into
google:mainfrom
volkthienpreecha:codex/adk-redis-memory

Conversation

@volkthienpreecha
Copy link
Copy Markdown

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

Problem:

ADK does not currently have a Redis-backed memory service. That means developers who want durable, self-hosted agent memory need to either use an existing hosted backend or keep memory in process with InMemoryMemoryService.

Solution:

I added RedisMemoryService as a focused implementation of the existing BaseMemoryService contract.

This PR adds Redis storage for memory events, lazy export from google.adk.memory, optional dependency support through google-adk[redis], and service registry support for redis:// and rediss:// memory service URIs.

Expected behavior:

After this change, developers can use Redis as a persistent memory backend. Sessions and events can be added to memory, searched by keyword, and scoped by app_name and user_id, while keeping behavior aligned with the existing InMemoryMemoryService.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

I added unit coverage for RedisMemoryService across session ingest, explicit event ingest, event appends, event deduping, session replacement, user scoping, case-insensitive search, empty sessions, and client cleanup.

I also added service registry tests for redis:// and rediss:// memory service URIs.

Passed locally:

PYTHONPATH=src python -m pytest \
  tests/unittests/memory/test_in_memory_memory_service.py \
  tests/unittests/memory/test_redis_memory_service.py \
  tests/unittests/cli/test_service_registry.py -q

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 31, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@adk-bot adk-bot added the services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc label May 31, 2026
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented May 31, 2026

Response from ADK Triaging Agent

Hello @volkthienpreecha, thank you for creating this PR!

We noticed that the Google Contributor License Agreement (CLA) check has failed.

Before we can review and accept your contributions, please make sure to sign the CLA as described in the Before you begin section of our contribution guidelines. You can visit https://cla.developers.google.com/ to check your current agreements or sign a new one.

This information is required for legal and licensing reasons to allow us to redistribute your contributions. Thank you for your cooperation!

@rohityan rohityan self-assigned this Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants