Co-authors:
Ajay Tandon, MongoDB
Nasit Qureshi, MongoDB
The MongoDB Integration for Google’s Agent Development Kit (ADK) helps you build agents that can store sessions and long-term memory with MongoDB. As agents move into production, they need more than powerful models. They need secure, dependable access to data and the ability to retain context over time. That means that you need tooling for a data store that provides durable agent memory for agent state. With the MongoDB Google ADK Integration, you can bring retrieval, session persistence, and memory into your agent architecture with a cohesive, ADK-native developer experience.
What is Google’s ADK?
Google’s ADK is an open source agent development framework that lets you build, debug, and deploy reliable AI agents at enterprise scale. It’s available in Python, TypeScript, Go, Java, and Kotlin.
Google ADK offers you an extensive set of tools so you can create, deploy, assess, and scale agents, and it lets you build anything from personal AI assistants to mission-critical business workflows.
How does the MongoDB Integration for ADK help?
You can prototype an agent that searches a product catalog or knowledge base, then evolve it into a production experience that preserves user context across conversations and recalls relevant prior interactions. With MongoDB as a unified data layer, you can store search data, vital conversation states, and agent memories directly alongside your application data. When you use MongoDB, there’s no separate database to set up for retrieval, no pipeline syncing application data into a different memory index, and no added latency pulling context from another system before the agent can respond.
ADK supplies the agent framework and tool interface: this integration provides the data and persistence layer beneath it, so you can easily take an agent from prototype to production. These agents can maintain conversation and session memory independent of any single machine, and they can carry a user’s history across sessions.
Providing a unified agent architecture
At the core of this integration is Google ADK 2.0, which serves as the code-first orchestration layer for multi-agent systems. ADK 2.0 provides the deployment framework, while MongoDB provides session and memory storage for agents.
Integrating directly with Gemini platform, ADK 2.0 eliminates the need for custom routing logic by providing standardized tool-calling interfaces, native telemetry, and enterprise access controls by default. You can use Gemini 4 Argon for multi-step reasoning and Gemini 3.8 Flash for low-latency execution.
How do sessions and memory storage work?
Great agent experiences improve with context. This integration introduces the MongoDbSessionService class to persist sessions, events, and application-, user-, and session-scoped state to MongoDB.
This persistence means that you can build agents that retain the context that they need for longer-running and multi-turn interactions. The session service includes optimistic concurrency control to help applications safely manage concurrent updates, while configurable collections make it easier to fit the service into existing data architectures.
The following Python code shows how you can add the MongoDbSessionService class to your agent:






