Introducing the MongoDB Integration for Google's ADK

Abirami Sukumaran
Staff Developer Advocate
Venkatesh Shanbhag
Builder Relations and AI Frameworks, MongoDB
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:
For agents that need memory beyond a single session, the MongoDbMemoryService class ingests session events into MongoDB collections and it recalls relevant memories through keyword matching. Memory ingestion is idempotent, which prevents duplicates when the application adds a session again. The following sample shows how you can add the MongoDbMemoryService class to your agent:
Together, these services help agents become more useful over time without requiring you to connect separate systems for retrieval, state, and memory.
How does MongoDB Search help agents with data retrieval?
Having memory for agent state is essential, but agents also need fast access to the operational data that they search over—the same product catalogs, documents, and records that your application already queries. You can also add MongoDB Search capability to your agents with ADK integration. This feature gives agents access to the right information and context at the right time, so they can deliver better responses in production. Whether you're building product discovery, knowledge assistants, support experiences, or domain-specific copilots, agents can automatically use semantic and hybrid retrieval to ground their responses in your data.
The following Python code shows how to add that capability:
The application owns the database connection, database name, and search configuration. The agent gets focused tools to call, without exposing those operational details in its context.
When you use MongoDB as the operational data store, the memory layer for agent state, and the search engine over both, you get one platform instead of three, on whatever deployment you run it on. There's no separate vector database to set up, no search engine to sync against a second copy of the data, and no added latency from the agent switching between systems before it can respond.
Which deployment versions does this integration support?
The integration supports MongoDB Atlas and self-managed MongoDB 8.0+ deployments for vector and hybrid search. You can provide a connection string or bring an existing PyMongo client, and configure the following search settings through the MongoDbToolSettings class, including index names, embedding fields, limits, and candidate counts.
That flexibility makes it possible to align the integration with existing data models, deployment choices, and performance requirements.
Get started today!
Install the MongoDB Google ADK Integration by running the following command:
To learn more about the integration, check out MongoDB's guide Get Started with the MongoDB Google ADK Integration.

