-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the contribution. I don't particularly understand this part: "By using Redis, we’re able to share session context across any number of instances, maintaining continuity and coherence throughout the conversation flow." Why does a shared memory can avoid the problems you mentioned. Could you help elaborate? |
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? |
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 theEvent
andSession
classes to support serialization and deserialization, and the inclusion of Redis as a dependency.New Redis-backed session service:
RedisMemorySessionService
class 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__.py
in thesessions
module to includeRedisMemorySessionService
in the exports. (src/google/adk/sessions/__init__.py
)Serialization and deserialization enhancements:
to_dict
andfrom_dict
methods to theEvent
class to enable serialization and deserialization of event objects. (src/google/adk/events/event.py
)to_dict
andfrom_dict
methods to theSession
class for similar functionality, enabling seamless handling of session data in the Redis service. (src/google/adk/sessions/session.py
)Dependency updates:
redis>=6.0.0
as a new dependency inpyproject.toml
to support the Redis-based session service. (pyproject.toml
)Consistency improvements:
Event
andSession
classes to use double quotes for consistency. (src/google/adk/events/event.py
) [1] [2] (src/google/adk/sessions/session.py
) [3]