Long term memory bank PreloadMemoryTool

Hi there

I use PreloadMemoryTool in adk agent, which can retrieves memories at the start of each turn and places them in the system instruction. reference How to build AI agents with long-term memory using Vertex AI Memory Bank & AD

However, this tool does not work by runner = adk.Runner(). note, I deploy my agent to GKE by get_fast_api_appif I do not use GKE, just run locally by adk web --memory_service_uri="agentengine:// , the memory can be retrieved.

So, it looks like PreloadMemoryTool does not support GKE/fast_api? any idea? thanks

Hi @ryandaii The issue isn’t GKE itself when you run with adk web, the PreloadMemoryTool is added automatically, but with get_fast_api_app it isn’t. On GKE you need to pass the memory_service_uri and add PreloadMemoryTool explicitly in your app setup, otherwise the agent won’t fetch memories at the start.

Hi @ryandaii ,

Thank you for the question.

We recently released an example that shows how to use Agent Engine Memory with ADK agent on GKE.

Check it out here.

Happy building!