Repository navigation
No way to delete memories from a MemoryService #6949
Description
Is your feature request related to a specific problem?
BaseSessionService has delete_session and BaseArtifactService has delete_artifact, but BaseMemoryService only has add_session_to_memory, add_events_to_memory, add_memory and search_memory. Once something is written to memory there is no way to remove it through ADK.
This comes up when a user asks for their data to be deleted. Sessions and artifacts I can handle. Whatever was extracted into long-term memory I cannot, so I end up going around ADK and deleting straight from the backing store.
Most of the pieces are already there. MemoryEntry has an id field, and the Vertex API has projects.locations.reasoningEngines.memories.delete. VertexAiMemoryBankService just doesn't wrap it. It only uses memories.create, memories.generate and memories.ingest_events.
Describe the Solution You'd Like
Two methods on BaseMemoryService:
async def delete_memory(self, *, app_name: str, user_id: str, memory_id: str) -> None
async def delete_memories(self, *, app_name: str, user_id: str) -> NoneFirst one deletes a single entry, second one everything stored for a user.
For VertexAiMemoryBankService both map onto memories.delete. InMemoryMemoryService keeps a dict so it's easy. Implementations that can't support it could raise NotImplementedError.
Impact on your work
I'm building agents for users in the EU, where a deletion request has to be answered within a month. Right now the memory part of that is a manual step outside ADK, and it's the part I can't show was actually done.
Willingness to contribute
Yes, happy to open a PR if you're OK with the method names and signatures.
Describe Alternatives You've Considered
Deleting from the backing store directly. It works but it's different for every implementation and bypasses ADK completely. The other option is not using MemoryService at all.
Version
google-adk 2.8.0
Activity
SabreKeyZ commentedon Aug 31, 2026
I'd like to work on this.
Plan: add
delete_memory(and a matching search-by-id if needed) onBaseMemoryService, implement it for the in-memory/sqlite services and wrap Vertexmemories.deleteonVertexAiMemoryBankService. Tests for delete-missing, delete-then-search, and the Vertex client call.Please confirm the method signatures before I open a PR, per CONTRIBUTING.
feat(memory): add delete methods for GDPR-style memory wipe
sanketpatil06 commentedon Aug 31, 2026
Hi @Chenjigaram , Thank you for your feature request. It is currently under review, and we will let you know if we need any further information. We appreciate your understanding.
SabreKeyZ commentedon Aug 31, 2026
There's a complete implementation in #6961 (CLA signed, checks green) if it's useful while this is under review. Happy to adjust the API to whatever the team prefers.
uvsohith2004 commentedon Oct 3, 2026
+1. If extracted memory can't be removed through the same API, you end up with a second, unofficial delete path that's hard to audit. Until delete_memory exists, recording session_id in MemoryEntry ids at write time at least makes backing-store cleanup provable. (I work on Breeth, a memory API with retraction and hard delete built in, in case you need it before ADK ships this.)
DeanChensj commentedon Oct 7, 2026
Cross-referencing #7109 (closed as a duplicate of this issue), which includes a detailed design discussion on
MemoryEntry.idround-tripping across memory backends (InMemoryMemoryService,FirestoreMemoryService,VertexAiMemoryBankService, andVertexAiRagMemoryService) as well as open PR #7175 alongside PR #6961.1320800521 commentedon Oct 15, 2026
Independent recheck on 2026-10-15 (pinned versions; not a claim about the latest release):
google-adk==2.8.0and2.9.0,InMemorySessionService+InMemoryMemoryService; no external model/Vertex API calls.add_session_to_memory()→search_memory()finds the marker →delete_session()→ check session and memory again.session_exists_after_delete=false,memory_found_before_delete=true,memory_found_after_delete=true, and the callableBaseMemoryServicedelete-method list is empty. The existing assertion-based version matrix passed again today.For the proposed #6961 / #7175 implementations, useful regression cases would be delete-then-search, missing IDs, user namespace isolation, and MemoryEntry.id round-tripping across supported backends.
Independent repro + version matrix: https://github.com/xbstack/google-adk-memory-delete-session-repro
Test evidence and data-deletion boundary: https://www.xbstack.com/en/ai/google-adk-delete-session-memory-retained/?utm_source=github&utm_medium=referral&utm_campaign=google_adk_memory_delete&utm_content=issue_comment
Small source-reference correction: the related memory report is #7109 (closed duplicate of this issue); #7110 concerns duplicate agent names and is unrelated.
feat: add delete_memory api to BaseMemoryService