Skip to content

AttributeError: module 'google.adk.tools' has no attribute 'preload_memory_tool' #1771

@jorgemontalvao

Description

@jorgemontalvao

Describe the bug


AttributeError Traceback (most recent call last)
Cell In[5], line 15
11 "If the tool is successful, present the weather report clearly."
12 "You can help the user find what city has better weather based on their preferences using the preload memory tool.",
13 tools=[
14 get_weather,
---> 15 adk.tools.preload_memory_tool.PreloadMemoryTool(),
16 ], # Pass the function directly
17 )
18

File c:\Users\GetInfo\Documents\express-mode-weather-agent.venv\Lib\site-packages\google\adk\tools_init_.py:102, in getattr(name)
100 """Lazy loads tools to avoid expensive imports."""
101 if name not in _LAZY_MAPPING:
--> 102 raise AttributeError(f'module {name!r} has no attribute {name!r}')
104 module_path, attr_name = _LAZY_MAPPING[name]
105 # name is google.adk.tools and we are doing a relative import
106 # from there.

AttributeError: module 'google.adk.tools' has no attribute 'preload_memory_tool'

To Reproduce

Steps to reproduce the behavior:

  1. Open file directory using VS Code
  2. Run following comands
    uv init uv add google-adk
  3. Open express-mode-weather-agent.ipynb
  4. Select recommended python interpreter (it must be the .venv related)
  5. Run each cell up to cell code "5"

A clear and concise description of what you expected to happen.

Image

Versions

  • OS: Windows 11
  • ADK version: 1.34.0
  • Python version: 3.14

Fix
Replace by
from google.adk.tools.preload_memory_tool import PreloadMemoryTool memory_tool = PreloadMemoryTool()
Reference:
https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/memory-bank/adk-quickstart?hl=pt-br#define_a_memory_retrieval_tool

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions