- Use cases: iOT, App Driven-Analytics, Gen AI
- Industries: Manufacturing and Motion
- Products and tools: Atlas Vector Search, Atlas Database
The automotive and mobility industry is undergoing a significant transformation, driven by advancements in vehicle connectivity, autonomous systems, shared mobility, and electrification. Vehicles today are sophisticated machines that generate massive amounts of data. Automotive demand will grow by 3% annually in the next 20 years with increased preference towards connected and electric vehicles. Automotive players are embracing artificial intelligence (AI), battery electrical vehicles (BEVs) and software-defined vehicles (SDVs) to maintain their competitive advantage. The global connected vehicles market size is expected to be worth around USD 446.6 billion by 2033, growing at a CAGR of 19.5% between 2024 to 2033. Managing fleets of connected vehicles is a challenge. As cars get more sophisticated and integrated with internal and external systems, the volume of data greatly increases. This data needs to be stored, transferred, and consumed by various downstream applications to unlock new business opportunities. The global fleet management market is projected to reach USD 65.7 billion by 2030, growing at a rate of almost 10.8% annually.
A 2024 study conducted by Webfleet revealed that 32% of fleet managers believe AI and machine learning will significantly impact fleet operations in the coming years. It narrowly surpasses the 30% who cited EVs as the primary game-changer. Optimising route planning and improving driver safety are the two most commonly cited ways fleet managers believe AI will change their working day. As fleet management software providers continue to invest in AI, integrating agentic AI, autonomous systems capable of making real-time decisions, can significantly help with use cases like route optimization and driver safety enhancement. For example, AI agents can process real-time traffic updates and weather conditions to dynamically adjust routes, ensuring timely deliveries while advising drivers on their car condition as needed. This proactive approach contrasts with traditional reactive methods, improving vehicle utilization and reducing operational and maintenance costs.
An agent is an operational application that attempts to achieve a goal by observing the world and acting upon it using the data and tools it has at its disposal. The term "agentic" denotes having agency as an AI agent, proactively taking steps to achieve objectives without constant human oversight. For example, rather than just reporting an anomaly based on connected car telemetry data analysis, an agentic AI system for a connected fleet could autonomously cross-check that anomaly against known issues, decide whether it's critical or not, and schedule a maintenance appointment all on its own.
In this solution, we will build an AI-powered Connected Fleet Advisor built using MongoDB Atlas, Voyage AI, OpenAI, and LangGraph.
The system receives driver complaints or fleet manager queries, processes vehicle telemetry data, generates a chain-of-thought, performs a vector search for similar issues, persists the data in MongoDB, and finally produces a diagnostic recommendation using an OpenAI LLM.
The reference architecture shown below illustrates the inner workings and data flow of the AI agent. The workflow begins when a user (driver) query is received about a potential issue (for example hearing a knocking sound). This request is then processed by the LangGraph-based agent orchestrator, which uses an LLM (OpenAI GPT-4o) to interpret the request and create a chain of thought (CoT) reasoning and workflow. The workflow is then executed by the agent using tools such as Atlas Vector Search.
The agent processes an issue report by:
Reading telemetry data: Ingests vehicle sensor data from a CSV file (or an API in a production setup).
Generating an embedding: Uses Voyage AI embedding API to convert the complaint text into a numerical representation.
Atlas Vector Search: Searches for similar issues in MongoDB Atlas using the generated embedding.
Data persistence: Saves telemetry data, session logs, and recommendations in MongoDB Atlas.
Final recommendation: Uses OpenAI chat API to produce actionable diagnostic advice.
An agent requires different types of data to function. MongoDB’s document model allows you to easily model all of this data in one single database. Below you will find one example per different data type found in an agentic AI application for fleet management. Notice how the flexibility of the document model can be adapted to suit the type of data required to be stored.
This contains the identity of the agent. It includes instructions, goals and constraints.
Example of an Agent Profile
This holds temporary, contextual information—recent data inputs or ongoing interactions—that the agent uses in real-time. For example, short-term memory could store sensor data from the last few hours of vehicle activity. In certain agentic AI frameworks like LangGraph, short term memory is implemented through a checkpointer. The checkpointer stores intermediate states of the agent’s actions and/or reasoning. This memory allows the agent to seamlessly pause and resume operations.
Example of short term memory - Telemetry data stored in Time Series Collections
This is where the agent stores accumulated knowledge over time. This may include patterns, trends, logs, historical recommendations, and decisions.
Example of long term memory - historical issues with connected vehicles vectorized and stored in MongoDB
The solution integrates several key technologies. To build this solution there are a few pre-requisities.
We implement a multi-step diagnostic workflow using LangGraph. The backend reads telemetry data from a CSV file (simulating vehicle sensor inputs), generates text embeddings using Voyage AI, performs vector searches to identify similar past issues from MongoDB, persists session and run data, and finally generates a diagnostic recommendation.
The flexible document model database stores agent profiles, historical recommendations, telemetry data, session logs, and more. This persistent storage not only logs every step of the diagnostic process for traceability but also enables efficient querying and reusability of past data.
1. Clone the repository and navigate to the backend directory:
2. Create and activate a virtual environment:
3. Install dependencies:
4. Configure environment variables:
Create a .env file in the backend directory with the following content:
5. Run create_issue_embeddings.py to create and store embeddings in MongoDB.
6. Create a Atlas Vector Search index with name issues_index and path embeddings.
For more details on how to set up Vector Search index, go to this link
7. Run the backend server:
8. Frontend Setup
Navigate to the frontend directory and install dependencies:
9. Run the Next.js development server:
The frontend should now be accessible at http://localhost:3000.
10. Feel free to adjust the prompt in main.py or update the telemetry data in the telemetry_data.csv file.
Building agentic AI solutions for mobility requires a robust data infrastructure. MongoDB Atlas offers several key advantages that make it an ideal foundation for these AI-driven architectures.
Scalability and flexibility: Connected car platforms such as fleet management systems need to handle extreme data volumes and variety. MongoDB Atlas easily scales horizontally across cloud clusters, letting you ingest millions of telemetry events per minute and store terabytes of telemetry data with ease. For example, ZF SCALAR uses MongoDB to process 90,000 vehicle messages per minute (over 50 GB of data per day) from hundreds of thousands of connected cars. The document model seamlessly adapts as the fleet grows. Developers can evolve schemas as vehicles add new sensors or features. This flexibility accelerates development and ensures your data model stays aligned with the real-world entities (vehicles, trips, incidents) it represents.
Built-in vector search: AI Agents require a robust set of tools to work with. One of the most widely used tools is vector search, which allows the agent to perform semantic search on unstructured data such as driver logs, error codes descriptions, and repair manuals. MongoDB Atlas has native support for vector search, which allows you to store and index high-dimensional vectors alongside your operational data and perform fast similarity queries over them. In practice, this means your AI embeddings live right next to the relevant vehicle telemetry and operational data in the database. This drastically simplifies architectures for use cases like the connected car incident advisor, where an issue can be matched against past issues encountered before passing the context to LLM. (See how an automotive OEM leverages vector search for audio based diagnostics with MongoDB Atlas Vector Search.)
Time series collections and real-time data processing: MongoDB Atlas is designed for real-time applications. It provides time series collections for connected car telemetry data storage, change streams, and triggers that can react to new data instantly. Given that real-time visibility is a top feature in modern fleet management systems, MongoDB’s ability to serve fresh insights to the AI agents ensures the decisions they make are based on the latest information. This is crucial for agentic AI feedback loops, where ongoing data ingestion and learning are happening continuously.
Best-in-class embedding models with Voyage AI: MongoDB has recently acquired Voyage AI, a leader in embedding and reranking models. As Voyage AI embedding models get integrated in MongoDB Atlas, developers will no longer need to manage external embedding APIs, standalone vector stores, or complex search pipelines. AI retrieval will be built into the database itself, making semantic search, vector retrieval, and ranking as seamless as traditional queries. This will reduce the time required for developing Agentic AI applications.
Create this demo for yourself by following the instructions in this solution’s repository.
See how MongoDB can supercharge your AI journey.
Learn how MongoDB’s modern database supports the entire IoT data life cycle.