Commit 368a6fc
feat: add FirestoreSessionService for serverless session persistence
Adds a new session service backed by Google Cloud Firestore, providing
persistent, serverless session storage. This addresses the gap between
InMemorySessionService (dev-only) and DatabaseSessionService (requires
managing SQL infrastructure) for GCP-native deployments.
The implementation follows established ADK patterns:
- Extends BaseSessionService with all CRUD operations
- Supports three-tier state management (app/user/session)
- Events stored in Firestore subcollections (avoids 1MB doc limit)
- Lazy import via __getattr__ (same pattern as DatabaseSessionService)
- google-cloud-firestore added as optional 'firestore' extra
Ref: #3776
Co-authored-by: Cursor <[email protected]>1 parent ec660ed commit 368a6fc
File tree
4 files changed
+891
-0
lines changed- src/google/adk/sessions
- tests/unittests/sessions
4 files changed
+891
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
41 | 52 | | |
0 commit comments