Transforming Financial Services with MongoDB and IBM Watsonx.ai
July 21, 2025
Financial institutions around the world are increasingly adopting AI-driven solutions to enhance user experiences, streamline operations, and deliver personalized financial insights. As a part of the MongoDB AI Applications Program (MAAP), IBM’s Watsonx.ai and MongoDB Atlas unite to deliver scalable, enterprise-grade AI development. By integrating MongoDB Atlas and IBM Watsonx.ai, we’ve built an intelligent finance assistant that combines cutting-edge database management and generative AI (gen AI) capabilities.
Modern financial institutions face challenges in delivering personalized, real-time assistance to their customers. Generic chatbots or static systems often fail to address nuanced queries, limiting their utility and customer satisfaction. By using MongoDB Atlas Vector Search and IBM Watsonx.ai’s gen AI models, we can create a finance assistant capable of handling complex queries, retrieving relevant financial data, and providing actionable insights.
This blog post will walk you through:
-
The core architecture behind the finance assistant.
-
The ways that MongoDB Atlas and IBM Watsonx.ai complement each other in building AI-driven financial solutions.
-
The method of building an intelligent finance assistant with MongoDB Atlas and IBM Watsonx.ai.
Architecture overview
The architecture of the finance assistant integrates advanced Vector Search capabilities with IBM Watsonx.ai’s reasoning and language generation models. The system provides an end-to-end pipeline for handling user queries, from natural language understanding to intelligent data retrieval and response generation.

Key components
Each component plays a specific role in enabling natural language understanding, data retrieval, and intelligent response generation.
- User input: Users interact with the Finance Assistant using natural language queries like:
- “What are my last three transactions?”
- “How can I improve my savings?”
- IBM Watsonx.ai
- Granite embedding models: Convert user queries into high-dimensional vector embeddings that represent semantic meaning.
- Granite language models: Generate intelligent and context-aware responses by reasoning over retrieved data.
- MongoDB Atlas
- Vector search index: Stores vector embeddings of transactional and financial data for fast, accurate similarity-based retrieva.l
- Hybrid search: Combines keyword search with vector similarity for holistic data retrieval.
- Operational data store: Maintains structured and unstructured financial data in a scalable and secure database.
- LangChain
- Orchestrates the flow between MongoDB Atlas and IBM Watsonx.ai.
- Implements retrieval-augmented generation (RAG) for real-time query handling and response generation.
The flow of the architecture
Describes how user queries are transformed into insights through embedding, retrieval, and AI-driven response generation.
- Preprocessing
- Financial data, such as customer transactions or private knowledge bases, is vectorized using IBM Watsonx.ai embedding models.
- Vector embeddings are stored in MongoDB Atlas alongside metadata.
- Query execution
- User input is processed into embeddings and matched against the Vector Search index.
- Relevant data is retrieved and passed to IBM Watsonx.ai for contextual reasoning.
- Response generation
- Watsonx.ai generates intelligent, explainable recommendations based on the retrieved data..
- The response is delivered to the user in natural language.
Why MongoDB Atlas?
MongoDB Atlas provides a powerful platform for managing and querying large-scale data using its vector search capabilities. When building a RAG pipeline, it simplifies the process by enabling the storage of vectorized embeddings alongside metadata in a flexible schema. Its hybrid search capabilities—combining traditional keyword searches with vector similarity searches—make it ideal for efficiently retrieving relevant documents or financial data based on user input. MongoDB Atlas also provides scalability and real-time data updates, making it a robust operational data layer for dynamic RAG workflows. By seamlessly integrating vector search with existing data, MongoDB Atlas minimizes latency and complexity so that your gen AI applications can retrieve the right context every time.
Why IBM Watsonx.ai?
IBM Watsonx.ai brings enterprise-grade foundation models to power the reasoning and generative components of a RAG pipeline. Watsonx.ai’s foundation models, such as the Granite series, offer robust embeddings and advanced reasoning capabilities, enabling the system to process retrieved documents and generate natural language responses tailored to the user’s query. With its focus on transparency, security, and customization, Watsonx.ai is particularly suited for regulated industries like finance. Its integration with tools like LangChain facilitates seamless orchestration between retrieval and generation, enabling RAG systems to go beyond static responses by delivering personalized, insightful, and context-rich outputs.
Method for building an intelligent finance assistant with MongoDB Atlas and IBM Watsonx.ai
For this tutorial, we will be using a financial dataset containing customer details, transactions, spending insights, and metadata. These records represent real-world information such as payments, savings, and expenses, making the dataset highly relevant for building an intelligent finance assistant. To generate the vector embeddings for storing and retrieving this data, we will use the Granite embedding models from IBM Watsonx.ai. These embeddings capture the semantic meaning of financial data, enabling efficient similarity searches and contextual data retrieval.
To follow along, you will need an integrated development environment, a MongoDB Atlas account for data storage and indexing, and an IBM Watsonx.ai account for generating embeddings. By the end of this tutorial, you’ll have a functional system ready to support real-time financial assistance and personalized recommendations.
Prerequisites
Before starting the implementation, ensure you have the following set up:
- MongoDB Atlas: Cluster with transaction and customer data collections. MongoDB Atlas will be the primary database for storing and querying transaction and customer data.
Steps:
- Create a MongoDB Atlas account
- Visit MongoDB Atlas and click “Get Started.”
- Sign up using your email or log in with Google, GitHub, or Microsoft.
- Set up a cluster
- Click “Build a Cluster” after logging in.
- Choose a free tier cluster or upgrade for more features.
- Select your cloud provider (AWS, Google Cloud, or Azure) and region.
- Click “Create Cluster” to deploy (this may take a few minutes).
- Configure your cluster
- Go to “Database Access” and create a user with a username, password, and role (e.g., “Read and Write to Any Database”).
- In “Network Access,” add your IP address or allow all IPs (0.0.0.0/0) for unrestricted development access.
- IBM Watsonx.ai: API key for accessing large language models (LLMs). IBM Watsonx.ai will handle the reasoning and generative tasks.
Steps:
- Create an IBM Cloud account
- Visit IBM Cloud and sign up for a free account.
- Set up Watsonx.ai
- Log in and search for “Watsonx.ai” in the catalog.
- Create an instance; a sandbox environment will be set up automatically.
- Generate an API key
- Go to “Manage,” then “Access (IAM)” in the IBM Cloud dashboard.
- Click “Create API Key,” name it (e.g., “watsonx_key”), and save it securely.
- Retrieve service URL
- Find the service URL (e.g., https://us-south.ml.cloud.ibm.com) in the Watsonx.ai instance dashboard.
You’re ready to start building your finance assistant!
Implementation steps
To set up and run your finance assistant, follow the steps below to clone, configure, and execute the code. Ensure that your MongoDB Atlas cluster and IBM Watsonx.ai configurations are ready before proceeding.
Step 1: Clone the code repository.
- The demo code is available on GitHub.
- Clone the project repository from the provided GitHub link, using this command:
git clone <repository_url>
cd <repository_directory>

#Install dependencies (requires python version 3.11 or higher)
pip install -r requirements.txt

- This repository contains all the necessary files, including preprocessing.py, processing.py, and the HTML templates.
Step 2: Configure the preprocessing script.
- Open the preprocessing.py file. This script is responsible for ingesting and vectorizing the financial data into MongoDB Atlas.
- Locate the MONGO_CONN variable and replace it with your MongoDB Atlas connection string:
MONGO_CONN = "<your_mongodb_connection_string>"

- Save the file.
Step 3: Run the preprocessing script.
- Execute the preprocessing.py script to preprocess and ingest the financial data into MongoDB Atlas:
python preprocessing.py

- If the script runs successfully:
- A new database named banking_quickstart will be created in your MongoDB Atlas cluster.
- The following collections will appear:
- faqs
- customers_details
- transactions_details
- spending_insight_details

- The script will also generate vector embeddings for textual data, enabling efficient similarity searches in MongoDB Atlas.

- Create a vector search index as follows for all four collections. Change the field name accordingly:

Step 4: Configure the processing script
- Open the processing.py file. This script integrates IBM Watsonx.ai for reasoning and query handling.
- Update the following variables:
- MONGO_CONN: Your MongoDB Atlas connection string
- Watsonx.ai Configuration:

- These configurations enable secure access to both MongoDB Atlas and Watsonx.ai for data retrieval and AI-powered query handling.
Step 5: Run the processing script
- Execute the processing.py file to start the backend Flask server: python processing.py.
- If the server starts successfully, the application will be hosted locally at 127.0.0.1.
Step 6: Access the application
- Open your browser and navigate to the following URL: http://127.0.0.1:5000/login
- You will see the finance assistant login page. Use the provided credentials (or modify the preprocessing.py script to create custom login data).
- Use any customer i.d. between 1-1000. Eg: CUST0571


Watch the full tutorial:
Additional technical details
- Preprocessing with Watsonx.ai: During the execution of preprocessing.py, the Granite embedding models from Watsonx.ai are used to vectorize textual data (e.g., transaction descriptions). The generated embeddings are stored in MongoDB Atlas for similarity-based queries.
- API configuration: The processing.py script integrates with IBM Watsonx.ai’s Granite language models to process natural language queries and generate meaningful responses.
- Server logs: Check the terminal logs for any errors or status updates during the execution of the Flask server. Logs provide insights into API calls, database interactions, and AI responses.
The power of advanced vector search and enterprise AI
Building a finance assistant using MongoDB Atlas and IBM Watsonx.ai demonstrates the power of combining advanced vector search capabilities with enterprise-grade AI models. This architecture not only provides real-time, accurate, and personalized financial insights but also highlights the scalability and flexibility needed for modern financial applications.
In this tutorial, you’ve learned how to:
- Preprocess financial data using Watsonx.ai’s Granite embedding models to create vector embeddings.
- Store and query data efficiently in MongoDB Atlas using its Vector Search index and hybrid search capabilities.
- Integrate IBM Watsonx.ai’s foundation models for intelligent reasoning and natural language understanding.
- Build a seamless user interface to enable customers to access their financial information intuitively.
And with this system, you can deliver:
- Personalized financial insights: Deliver tailored responses for individual users based on their financial data.
- Scalable performance: Effortlessly handle large datasets and complex queries.
- Enhanced user experiences: Provide customers with real-time, explainable, and context-aware recommendations.
As the financial services sector continues to evolve, combining tools like MongoDB Atlas and IBM Watsonx.ai will become essential for delivering smarter AI-driven solutions. You can easily extend this architecture to include advanced analytics, fraud detection, or even investment forecasting, making it a robust foundation for future innovation.
Ready to take your finance assistant to the next level? Start experimenting with more data, refining AI prompts, or exploring MongoDB Atlas and Watsonx.ai’s advanced features to unlock even greater potential!
To fast-track your AI journey, explore the MongoDB AI Applications Program (MAAP). It brings together cutting-edge technologies and expert services from top AI and tech leaders including IBM to help your organization move seamlessly from concept to road map, prototype, and full-scale production.