Redis-backed session service for Google ADK
Project description
google-adk-redis
Redis-backed session service for Google ADK.
Install
From a Git repo:
pip install git+https://github.com/hucruz/google-adk-redis.git
From PyPI (once published):
pip install google-adk-redis
Usage (programmatic)
from google_adk_redis import RedisMemorySessionService
session_service = RedisMemorySessionService(
host="localhost",
port=6379,
db=0,
expire=60 * 60,
)
Optional register for google.adk.sessions
import google_adk_redis
google_adk_redis.register()
from google.adk.sessions import RedisMemorySessionService
Usage with Google ADK (Runner)
import asyncio
from google.adk.agents.llm_agent import LlmAgent
from google.adk.runners import Runner
from google.genai import types
from google_adk_redis import RedisMemorySessionService
async def main():
session_service = RedisMemorySessionService(
host="localhost",
port=6379,
db=0,
expire=60 * 60,
)
agent = LlmAgent(
name="assistant",
model="gemini-2.0-flash",
instruction="You are a helpful assistant.",
)
async with Runner(
app_name="demo-app",
agent=agent,
session_service=session_service,
) as runner:
session = await session_service.create_session(
app_name="demo-app",
user_id="user-123",
)
async for event in runner.run_async(
user_id=session.user_id,
session_id=session.id,
new_message=types.Content(
role="user",
parts=[types.Part(text="Hola!")],
),
):
if event.content and event.content.parts:
text = "".join(part.text or "" for part in event.content.parts)
if text:
print(text)
asyncio.run(main())
Authors
- BloodBoy21 (original implementation, https://github.com/BloodBoy21)
- hucruz (upstream contributions, https://github.com/hucruz)
Maintainer
- hucruz (https://github.com/hucruz)
Attribution
Source repository: https://github.com/BloodBoy21/nerds-adk-python/tree/feat-redis-session
This repository packages and adapts the upstream implementation for standalone use.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file google_adk_redis-0.1.2.tar.gz.
File metadata
- Download URL: google_adk_redis-0.1.2.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d3ad17036ea4773e70eac819ab02b19cb7ac44f9598bf3c5a8eb9974cb82a46
|
|
| MD5 |
8cc5511ca6ee1a34bb2e706fd8bdcbeb
|
|
| BLAKE2b-256 |
70190d1c319ee97881936471559566d92ce9f2d21316519ddca3cd9b852d28cf
|
Provenance
The following attestation bundles were made for google_adk_redis-0.1.2.tar.gz:
Publisher:
workflow.yml on hucruz/google-adk-redis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
google_adk_redis-0.1.2.tar.gz -
Subject digest:
4d3ad17036ea4773e70eac819ab02b19cb7ac44f9598bf3c5a8eb9974cb82a46 - Sigstore transparency entry: 821196308
- Sigstore integration time:
-
Permalink:
hucruz/google-adk-redis@df10c8599960a7d325c4518bd8901c2c517234f9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hucruz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@df10c8599960a7d325c4518bd8901c2c517234f9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file google_adk_redis-0.1.2-py3-none-any.whl.
File metadata
- Download URL: google_adk_redis-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd2c18a5a6866e8f3011205f9059d0db9699fd8497f728f674902a5bcda56381
|
|
| MD5 |
f63d63cc36ce0c8ce645d1f0cc43e817
|
|
| BLAKE2b-256 |
eaa16f0ae7551cca7853cc616a08128eb82e022c6d0b5bfa26605b989cb727e6
|
Provenance
The following attestation bundles were made for google_adk_redis-0.1.2-py3-none-any.whl:
Publisher:
workflow.yml on hucruz/google-adk-redis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
google_adk_redis-0.1.2-py3-none-any.whl -
Subject digest:
cd2c18a5a6866e8f3011205f9059d0db9699fd8497f728f674902a5bcda56381 - Sigstore transparency entry: 821196310
- Sigstore integration time:
-
Permalink:
hucruz/google-adk-redis@df10c8599960a7d325c4518bd8901c2c517234f9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hucruz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@df10c8599960a7d325c4518bd8901c2c517234f9 -
Trigger Event:
workflow_dispatch
-
Statement type: