BaseMemoryService. This allows your Google GenAI agents to automatically store session events and retrieve relevant context using MemMachine’s hybrid episodic and semantic search.
Overview
By using theMemmachineMemoryService, your ADK agents can:
- Auto-Archive Sessions: Automatically move completed ADK session events into MemMachine episodic memory.
- Contextual Recall: Use the standard ADK
load_memorytool to query past interactions across different sessions. - Scoped Search: Metadata like
app_nameanduser_idare automatically preserved to ensure privacy and relevance.
Configuration
The adapter is configured via constructor arguments when initializing the service.1
Install with ADK Extra
To ensure all Google GenAI and ADK dependencies are included, install the client with the
google-adk extra:2
Initialize the Memory Service
Create an instance of the
MemmachineMemoryService. This service acts as the bridge between Google ADK and your memory backend.3
Equip the Agent
Add the standard
load_memory tool to your LlmAgent. This allows the agent to decide when it needs to “look back” at past conversations to answer a query.4
Wire the Runner
Connect your agent, session service, and the MemMachine memory service into a
Runner.Memory Lifecycle
Persistence
To move a session from active memory into long-term storage (so it can be recalled by other sessions), calladd_session_to_memory once a conversation is finished:
Retrieval
When the agent invokesload_memory, the adapter automatically filters results based on the app_name and user_id defined in the Runner, ensuring the agent only recalls information relevant to the current user.
Important: The ADK integration requires Python 3.10+ and the
google-adk extra package. If you encounter import errors, verify that you have installed memmachine-client[google-adk]. 
