ANNOUNCEMENTVoyage AI joins MongoDB to power more accurate and trustworthy AI applications on Atlas. Learn more >
NEWMongoDB 8.0: Experience unmatched speed and performance. Check it out >
AnnouncementMongoDB 8.0: Experience unmatched speed and performance. Check it out >

Solutions

Framework for Rapid AI Agent Deployment

MongoDB Atlas enables rapid development of AI agents across industries.
Start Free
Generative AI agent illustration.
Solution Overview

In 2025, agentic AI applications are no longer just a hobby project. Companies around the world are investing in software to incorporate AI agents into their business workflows. The most common use of an AI agent is to assist with research analysis or writing code. Langchain’s recent survey of over 1,000 professionals across multiple industries showed that over 51% have already deployed agents in production—with 60% using the agents for research and summarization tasks.

However, leveraging an AI agent for more complex tasks than research and summarization, and deploying them at scale, presents certain challenges.

  1. Complex data integration and handling: AI agents often rely on disparate data sources and formats (structured logs, unstructured text, and sensor streams) making it difficult to unify data for real‐time decision‐making. Having all relevant data stored in one database for the agent to consume helps speed up the development process.

  2. High concurrency and low latency: Agents in production must handle a large volume of requests and respond quickly, which can overwhelm databases that aren’t built for high throughput and performance. While LLM inference can add latency, database performance is still important, especially as agents scale. Production agents will run in parallel, make multiple tool calls, and rely on up-to-date information to make decisions. A slow database becomes a bottleneck that increases total response time, reducing the agent’s ability to act in real time.

  3. Data governance and security: Sensitive data like user logs, sensor readings, and PII must be stored and accessed securely all while maintaining compliance (e.g. GDPR, SOC 2). Secure databases like MongoDB Atlas provide built-in, advanced security controls such as client side field-level encryption, queryable encryption, and extensive auditing capabilities. These features help ensure that agents only access the data they are authorized to see and traceability is maintained.

Basic components of an AI agent
Figure 1. Basic components of an AI agent

Figure 1 shows the major components of an AI agent. The agent will first receive a task from a human or via an automated trigger and will then use an LLM to generate a chain of thought or follow a predetermined workflow. The agent will use various tools and models during its run and store and retrieve data from a memory provider like MongoDB Atlas.

The primary goal of this solution—the agentic framework—is to accelerate the development of AI-driven workflows by providing a flexible and extensible foundation. Rather than offering a fixed set of tools or functionalities, the framework is designed to serve as a starting point for building intelligent agents tailored to specific use cases across various industries.

You can follow along this solution and easily set up a toolkit powered by MongoDB Atlas and LangGraph, and then use it to create many agents with linear workflows. The simplicity of the solution allows users to quickly understand how to build a basic agent just by manipulating the config files. For more complex use cases or advanced agents, you may extend the framework by adding new tools, nodes, conditions, or workflows as needed.

By prioritizing adaptability and modularity, the agentic framework empowers developers to create AI agents that are not only efficient but also highly customizable to meet the unique demands of their industries or projects.

Reference Architecture

The agentic framework is a versatile AI-driven recommendation assistant designed to understand your data, execute a multi-step diagnostic workflow using LangGraph, and generate actionable insights. It seamlessly integrates multiple technologies, reading time-series data from a CSV file or MongoDB (simulating diverse data sources), generating text embeddings, and performing vector searches to identify similar past queries. The framework also persists session and run data, ultimately producing a diagnostic recommendation.

MongoDB serves as the backbone for storing agent profiles, historical recommendations, time-series data, and session logs, ensuring full traceability of the diagnostic process while enabling efficient querying and reusability of past insights.

AI Agent reference architecture
Figure 2. AI Agent reference architecture
Why MongoDB

MongoDB plays a pivotal role in enabling agentic AI. MongoDB's unique combination of flexibility, performance, and scalability makes it an ideal choice for enabling artificial intelligence. The MongoDB document model enables native storage and retrieval of structured, semi-structured, and unstructured data, and it seamlessly handles diverse and complex datasets. MongoDB empowers AI agents to react dynamically to new information, maintain internal states in real-time, and continuously learn and evolve.

Flexible data model: MongoDB's architecture provides a powerful foundation for agentic AI systems by offering unparalleled flexibility in data storage. The document model allows you to store varied data such as time series logs, agent profiles, and recommendation outputs in a single, unified format. This flexibility means you don’t have to redesign your database schema every time your data requirements evolve. MongoDB's flexible schema enables AI agents to store complex, hierarchical agent states with nested documents that can dynamically adapt to changing agent characteristics and interaction contexts. MongoDB is an ideal choice for maintaining complex agent states across multiple interactions. It supports versioning and tracking agent evolution, with the ability to pause and resume agent contexts seamlessly.

Vector search: MongoDB Atlas supports native vector search, enabling fast and efficient similarity searches on vector embeddings. This is critical for matching current queries with historical data, thereby enhancing diagnostic accuracy and providing more relevant recommendations. Vector search can support pattern recognition and contextual retrieval that significantly enhance quality and decision making of AI agents. Vector search enables sophisticated information retrieval that uses a similarity algorithm to provide results that are more precise, reducing LLM hallucination. MongoDB can efficiently handle semantic matching, contextual searches, and multi-dimensional data analysis, all crucial for AI agents' decision making workflows.

Scalability, performance and high availability: MongoDB is designed to scale horizontally, making it capable of handling large volumes of real-time data. MongoDB’s seamless horizontal scalability supports large-scale, distributed AI applications with growing data requirements for AI workloads through distributed and sharding architecture. With MongoDB, AI agents can scale horizontally, distribute storage and computational load, and maintain high availability, ensuring consistent performance even when volume of data grows exponentially. MongoDB replica sets provide robust high availability out of the box that underpins the reliability and resilience of AI agents.

Coinbase, one of the largest cryptocurrency exchanges in the U.S., has effectively leveraged MongoDB to significantly enhance its platform scalability across 700 MongoDB clusters and overcome high volumes of unpredictable market traffic spikes.

Time series collections: MongoDB time series collections are designed to efficiently ingest large volumes of data with high performance and scalability. These specialized collections enable AI agents to track and analyze sequential interactions, learning patterns, and state changes over time, which is essential for maintaining context, understanding behavioral patterns, and implementing adaptive decision-making processes. By offering native time series optimizations such as automatic data compression, improved storage efficiency, and fast time-based query responses, MongoDB allows AI agents to maintain extensive current and historical records of their interactions, learning iterations, and performance metrics without compromising computational performance or data integrity.

Seamless integration: The seamless integration of MongoDB with agentic frameworks like LangGraph expedites the development of complex, stateful AI agentic systems. Through native support for JSON-like documents, dynamic schema, and powerful indexing capabilities, MongoDB enables LangGraph-powered AI Agents to maintain sophisticated data and memory structures, track multi-step reasoning processes, and implement advanced state management that can persist across sessions and provide comprehensive auditability of AI decision-making processes.

Building the Solution
Logical architecture
Figure 3. Logical architecture

Step 1: Include meaningful CSV data for your use case The data should be relevant to your use case and respect the following guidelines:

  • The CSV file should contain a header row with column names.
  • The first column must be named “timestamp” and contain timestamps in the format YYYY-MM-DDTHH:MM:SSZ, e.g. 2025-02-19T13:00:00Z.
  • The remaining columns should contain relevant data for your use case.
  • There is no column nor row limit, but for framework testing purposes the suggestion is to keep the data size as small as possible.

Sample data:

Within the same folder you need to add a queries file. This file will contain the queries that will be used to showcase vector search capabilities as part of the agentic workflow. The file should respect the following guidelines:

  • The CSV file should contain a header row with column names.
  • The first column must be named “query” and contain the queries.
  • The second column must be named “recommendation” and contain the expected recommendations.
  • There is no column or row limit, but for framework testing purposes the suggestion is to keep the data size as small as possible.

Sample data:

Step 2: Set up MongoDB database and collections

Log in to MongoDB Atlas and create a database named “agentic_<YOUR_USE_CASE>”, e.g. “agentic_macro_indicators”. Ensure the name is reflected in the environment variables.

Create the following collections:

  • agent_profiles (for storing agent profiles): You can import some sample data to this collection using this file.
  • queries (for storing queries): You must import the queries from the queries.csv file created in Step 1.

Step 3: Configure your agentic workflow through a JSON config file

Go to the config folder and create or update the JSON config.json file. The file should contain the following structure:

Once the config file is updated, environment variables need to be configured and vector embeddings created. Finally the vector search index must be created.

Check out the readme for detailed explanations of all the steps.

The agentic framework in action covering a financial services use case.
Figure 4. The agentic framework in action covering a financial services use case
The agentic framework in action covering a manufacturing use case.
Figure 5. The agentic framework in action covering a manufacturing use case
Key Learnings

Agentic AI ushers in an entirely new type of software—one with the ability to dramatically alter the way we process data to drive richer and more efficient business data processing outcomes. In order to leverage agents within business applications, software delivery teams will need to learn:

  • How agents get instructions for reacting within predetermined workflows.
  • How agents access and interact with tooling like APIs and databases.
  • How agents persist and manage state.

Many of these items can be considered baseline activities and setup for software delivery teams, regardless of the actual use case, workflow, or industry context for which an agent, or agentic workflow, will be deployed.

For high performing software delivery teams, the use of a framework to abstract common tasks and components has often been employed to speed up the development and deployment of business software solutions, as well as decrease the subsequent complexity of maintaining them. This agentic framework makes it easier for software delivery teams to get started with building agentic solutions, as well as maintain them, via common, configurable components and assets.

Working in this framework can not only teach you and your software teams how to get started with building agentic solutions, it can also help them build repeatable patterns and components that make it easier to scale and maintain your business solutions for the long term.

Authors
  • Julian Boronat, MongoDB
  • Peyman Parsi, MongoDB
  • Jeff Needham, MongoDB
  • Luca Napoli, MongoDB
  • Humza Akhtar, MongoDB
Related Resources
general_content_developer

GitHub Repository: Framework for Rapid AI Agent Development

Create this demo for yourself by following the instructions in this solution’s repository.

industry_ai

MongoDB for Generative AI

See how MongoDB can supercharge your AI journey.

industry_ai

MongoDB for Agentic AI

See MongoDB’s role in agentic AI as the memory provider.

Get started with Atlas

Get started in seconds. Our free clusters come with 512 MB of storage so you can experiment with sample data and get familiar with our services.
Try FreeContact sales
Illustration of hands typing on a laptop in the foreground and a superimposed desktop window and coffee cup in the background.