From 4dd28a3970d0f76c571caf80b3e1bea1b79e9dde Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Mon, 17 Nov 2025 18:33:35 -0800 Subject: [PATCH] feat: Add `id` and `custom_metadata` fields to `MemoryEntry` PiperOrigin-RevId: 833581243 --- src/google/adk/memory/memory_entry.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/google/adk/memory/memory_entry.py b/src/google/adk/memory/memory_entry.py index 5e40d78f..c0548d53 100644 --- a/src/google/adk/memory/memory_entry.py +++ b/src/google/adk/memory/memory_entry.py @@ -15,10 +15,12 @@ from __future__ import annotations +from typing import Any from typing import Optional from google.genai import types from pydantic import BaseModel +from pydantic import Field class MemoryEntry(BaseModel): @@ -27,6 +29,12 @@ class MemoryEntry(BaseModel): content: types.Content """The main content of the memory.""" + custom_metadata: dict[str, Any] = Field(default_factory=dict) + """Optional custom metadata associated with the memory.""" + + id: Optional[str] = None + """The unique identifier of the memory.""" + author: Optional[str] = None """The author of the memory."""