-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: ✨ redis session class #789
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
|
Any update on the status of this PR? |
|
Hi, we are preparing a new repo to house community contributions which will give more freedom to the community to add new features that extend ADK's features. Please stay tuned. |
Hi Bo! Are there any timeline available for that? We would love to add Redis session storage in our services. |
|
@hangfei do you have an ETA for the community repo? |
|
@boyangsvl this is very important feature to build scalable agents, it would be great, if we get some conclusion soon. |
|
Sorry for the delay. There are some processes we have to go through to create the repo. Please stay tuned. |
267215a to
2a55584
Compare
fix: fixed json serialization
fix: store session bytes as base64 to avoid invalid encoding errors
…python into feat-redis-session
|
I really need this kind of solution i'm building big project and i need to share my session between many services. |
|
@boyangsvl any timelines when this feature would be available |
|
Hi folks, could you migrate this PR to our community repo: https://github.com/google/adk-python-community. This work fits very well into domain of that repo. If you have any followup questions, feel free to raise them. |
|
If this Redis Session service is implemented in this new community repository, how will we use it? But this session_service_uri argument does not support a URI like "redis://" How would that work when the community creates other services? |
|
Hi @anoteboom, I'm thinking about a registry mechanism that allows people to register a session service to a URI schema. Do you have time to think about such a design? |
|
Hi folks. Following the work in this PR, I've implemented a Redis session service for the community repository. Also, a community FastAPI management is also available to support Redis URI: from google.adk_community.cli.fast_api import get_fast_api_app
app = get_fast_api_app(
agents_dir=AGENT_DIR,
session_service_uri="redis://..."
)I'd appreciate your review and welcome any contributions or feedback: google/adk-python-community#4. |
This pull request introduces a Redis-backed session service implementation, along with various enhancements and adjustments to improve consistency, functionality, and maintainability across the codebase. The most significant changes include the addition of the
RedisMemorySessionService, updates to theEventandSessionclasses to support serialization and deserialization, and the inclusion of Redis as a dependency.New Redis-backed session service:
RedisMemorySessionServiceclass to provide a Redis-backed implementation of session management. This includes methods for creating, retrieving, listing, and deleting sessions, as well as managing session state and events. (src/google/adk/sessions/redis_memory_session_service.py)__init__.pyin thesessionsmodule to includeRedisMemorySessionServicein the exports. (src/google/adk/sessions/__init__.py)Serialization and deserialization enhancements:
to_dictandfrom_dictmethods to theEventclass to enable serialization and deserialization of event objects. (src/google/adk/events/event.py)to_dictandfrom_dictmethods to theSessionclass for similar functionality, enabling seamless handling of session data in the Redis service. (src/google/adk/sessions/session.py)Dependency updates:
redis>=6.0.0as a new dependency inpyproject.tomlto support the Redis-based session service. (pyproject.toml)Consistency improvements:
EventandSessionclasses to use double quotes for consistency. (src/google/adk/events/event.py) [1] [2] (src/google/adk/sessions/session.py) [3]