Metadata-Version: 2.4
Name: adk-session-services
Version: 0.1.3
Summary: A Python package providing additional service implementations for the Google ADK framework (Redis, etc)
Project-URL: Homepage, https://github.com/tiyee/adk-session-services
Project-URL: Source, https://github.com/tiyee/adk-session-services
Author-email: tiyee <tiyee@live.com>
License: MIT
License-File: LICENSE
Keywords: adk,google-adk,redis,session-service
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: google-adk
Requires-Dist: google-generativeai>=0.8.5
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: redis>=5.0.0
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: editables>=0.5; extra == 'dev'
Requires-Dist: flake8; extra == 'dev'
Requires-Dist: hatchling; extra == 'dev'
Requires-Dist: isort; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: furo>=2023.9.10; extra == 'docs'
Requires-Dist: myst-parser>=2.0.0; extra == 'docs'
Requires-Dist: sphinx>=7.2.0; extra == 'docs'
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.25.0; extra == 'test'
Requires-Dist: pytest-mock>=3.14.0; extra == 'test'
Requires-Dist: pytest>=8.0.0; extra == 'test'
Requires-Dist: testcontainers>=3.10.0; extra == 'test'
Description-Content-Type: text/markdown

# adk-session-services

Session service implementations for [Google's Agent Development Kit (ADK)](https://github.com/google/adk-python). Provides persistent session storage backends as drop-in replacements for ADK's `BaseSessionService`.

## Features

- **Redis** — Persistent session storage via Redis with support for app-level and user-level state layering.
- **Firestore** — (Planned) Persistent session storage via Google Cloud Firestore.

## Installation

```bash
pip install adk-session-services
```

## Quick Start

### Redis

```python
from adk_session_services.redis_session import RedisSessionService

service = RedisSessionService("redis://localhost:6379")

session = await service.create_session(
    app_name="my-app",
    user_id="user-123",
)
```

## Redis Key Schema

All keys are prefixed with `adk:sessions:`:

| Key pattern | Type | Purpose |
|---|---|---|
| `{app}:{user}:{session}:meta` | Hash | Session metadata |
| `{app}:{user}:{session}:state` | String (JSON) | Session state dict |
| `{app}:{user}:{session}:events` | List (JSON) | Ordered event log |
| `{app}:{user}:sessions` | Set | Session IDs per user/app |
| `{app}:app_state` | Hash | App-level state (shared across users) |
| `{app}:{user}:user_state` | Hash | User-level state (shared across sessions) |

## Development

```bash
# Install with dev dependencies
pip install -e ".[dev]"

# Install with test dependencies
pip install -e ".[test]"

# Run tests
pytest

# Format
black src/ && isort src/

# Type check
mypy src/
```

## License

MIT
