Back to catalog / Agent memory
Retrieve relevant memories from completed agent sessions
Under user consent and retention rules, index completed sessions so later sessions can retrieve relevant context.
Goal
Let a new session retrieve authorized retained information from older sessions with traceable provenance.
Steps
- Define which conversations may be stored, when to ingest them, and how to delete them; disclose retention scope. [memory]
- Configure a memory service on the Runner and ingest only completed sessions. [memory]
- In a new session, retrieve relevant memories through a query tool and limit result count and user scope. [memory]
- Treat retrieved memories as context clues and check original session or time metadata before relying on them. [memory]
How to verify
A new session retrieves expected history within the same user scope; deleted records no longer appear.
Troubleshooting
If another user’s data appears, stop retrieval and inspect index keys and server-side filtering; do not rely on prompts for isolation.
Permissions
Prerequisites
- Python 3.11+, google-adk compatible with the pinned revision, and an isolated test environment
- Configured model-provider credentials for live inference; never place them in code or logs
- A configured SessionService; cross-session retrieval also requires a MemoryService
Permissions
- Use authorized test data only; isolate sessions and credentials per user; obtain human authorization before external side effects
Limitations
This procedure follows Google ADK at the pinned revision; other versions, models, or remote services may differ in APIs and event semantics. Recheck permissions, retention, and recovery before production.
Pinned upstream source
- Repository
- google/adk-python
- File path
- docs/guides/memory/memory_service/index.md
- Pinned commit
e9b74d36140f2594b24c481fb7a3825b2cb01e96- Source checked
- 2026-10-14 · Reviewed against the pinned upstream source
Repository metrics
These values describe the upstream repository, not popularity or likes for an individual skill or playbook.
- Stars
- Not collected
- Forks
- Not collected
- Observed at
- Not collected
No metrics snapshot is available yet.
License: Apache-2.0
Main topic
Turn ecommerce campaign materials into a reviewable weekly brief