AI for Data Intelligence Demo: Real-time fraud Detection with Databricks
Summary
- Mule account crisis: In Thailand, 31,000 mule accounts were flagged in 2025, costing banks $2.7 million and creating societal trust issues.
- Graph-based detection: This video demonstrates agentic AI deployed with governance and controls to detect fraudulent mule accounts using graph analysis.
- Databricks solution: Domain-trained AI agents in Databricks visualize risk and automate investigation workflows for fraud prevention.
AI for Data Intelligence Demo: Real-time fraud Detection with Databricks

Demo: Watch Mule Account Detection with domain-trained, agentic AI in action — deployed with strong governance and controls for high-impact scenarios.
Link to code on GitHub: https://github.com/xsergiolpx/mule-detection-databricks
Chapters
0:00The mule account challenge2:43Data and operational hurdles3:59The Databricks solution5:14Graph-based fraud detection9:01Visualizing risk with AI11:07Genie agent for investigation12:47Automated reporting and output14:28Reference architecture15:51Benefits and conclusion
FAQs
What is a mule account in banking?
A mule account is owned by an innocent person but used by criminals to move money from scams. In 2025, Thailand saw 31,000 flagged accounts used by over 1,000 daily scams.
What is the financial impact of mule account fraud?
In Thailand, direct losses reached $2.7 million plus approximately $3 billion in bank absorption costs for investigations and compliance—averaging $50–300 million per bank annually.
How does graph-based detection identify mule accounts?
The solution analyzes transactional patterns and relationships to identify accounts matching mule characteristics, integrating fragmented data sources into unified analysis.
What governance controls protect innocent account holders?
The agentic AI operates with strong governance and controls to minimize false positives, crucial because Thailand requires banks to unfreeze innocent accounts within 4 hours.
Full transcript
0:00 The mule account challenge
Hello everyone. solutions architect at Databricks, and I'm here today to talk about how we are helping banks in detecting mule accounts. Let me walk you through the problem statement before we start. Um mule account is an account owned by technically an innocent person. Could be for example, a student, but it is used by a criminal to pass through money that is retrieved through a scams to innocent people. And I'm focusing here on the market of Thailand where we have been working with customers, but it also applies to many other countries.
In Thailand specifically, there has been in the year 2025, 31,000 mule accounts flagged. And these mule accounts are being used to send money from over a thousand new scams that are happening happening daily. In other markets like US, UK, Switzerland, and many more, there are also similar issues. Now, in terms of impact for banks in Thailand, there was a loss of 2. 7 million US dollars. This is um losses mainly from the scams themselves, but also there are also losses from uh the costs that banks need to absorb.
Approximately, it is around 10%. So, 3 billion US dollar are the cost for banks for the investigations, the compliance burden, and also sometimes even refunds to the victims. And if we count how many major banks are there in Thailand, it is around 300 million US dollar per major bank. For a smaller banks, it is from 50 million to 60 million US dollars per year. Now, this is not only a problem for the banks themselves, but it's also a problem for the entire society.
It turns out that sometimes uh banks can make mistakes and they might flag uh an account as a mule account, but it's actually owned by an an used by a regular person. And in fact, there was a survey in 2025 where 60% of Thai nationals are afraid that if they receive a large transfer, it will their bank account might be flagged as a mule account and then they would lose access to their funds until, for example, they go to the bank to send some and they show some other documentation of where that money is coming from.
This was such a big problem that the Bank of Thailand created a regulation that the banks need to unfreeze innocent bank accounts within 4 hours, and this is creating a big issue in Thailand. This is actually uh data problem, and I will walk you through how. The reason is that to detect these mule accounts, the data are very fragmented usually. Data from transactions, in the case of Thailand, it comes from the PromptPay systems.
2:43 Data and operational hurdles
In other countries, it would be other systems. Know your customer information might be also stored in a different system. Device login data with all the observability data points is also collected through a different system, so it's very hard to stitch all these data points together to come up with the right signals. The second one is that many of the rules are business logic, and that is great because it comes with experience of people that have been working on this domain, but criminals are every day developing new techniques to overcome this uh rules.
And the last one is that once there are some accounts that are flagged as potential mules, investigators need to manually go there and verify if they are from a mule or not. Um this means comparing the screenshots, the transaction activity, PDF documents, and this uh is a lot of productivity loss. The solution that we bring with Databricks is first a unified architecture, a 360 view of all the data points that are surr- are attributed to the same customer and account.
3:59 The Databricks solution
So, this means that this advice login information uh documentation submitted by the customer, transactions, everything can be on a single plane. So, all the signals they come together. And these signals, instead of just sending them to a layer of business rules, they can be used with advanced ML, AI, and even graphs and networking algorithms to uncover complex mule networks. We'll dive into this a little bit later. And the uh last one is that the investigators, instead of switching between different systems, they can have a single pane of glass with an app where they would very easily just click and see what are all the data points corresponding to a single account.
And even if just like the information is not there, they can have access through Genie to query a specific um uh questions about the accounts that are not reflected or pre-built in this app. Let me show you how this looks like in a demo. There is going to be a little bit of code, but I will go through that quickly. The idea is that I'm on my Databricks workspace. And I have already loaded some tables that corresponds to customer information, to transactions, to device login, share contacts, and also a ground truth um submitted by the of Thailand with confirmed mule accounts.
5:14 Graph-based fraud detection
And these are kind of there are points that help us in identifying if other accounts are also mules. The idea is that we can create, for example, a graph where each one of these nodes correspond to an account and they are connected if money flows between them. In this case, we have here a small sample where an account is sending money to this other account and then to this other account and nothing is um strange or irregular here.
But, what we want to really achieve is to detect these other nodes, the ones that are suspected to be mule accounts because they have some kind of relationship with an existing mule account or because maybe uh there is some other pattern that is flagging them. The complexity is doing this at scale. And I have loaded here is a synthetic data set of 1,000 accounts with some of them confirmed mule accounts by the Bank of Thailand.
And we can see how they are flagged here and they are somehow related to what nodes. These nodes could be victims or they could be as well mule accounts. We don't know, but we know that among these network, there are a few that will be mule accounts. There are many different ways of solving this problem. One is through anomaly detection. Also, we have some ground truth from the Bank of Thailand, so we have examples of accounts that were mules and other ones are not mules.
Um and also through graph analytics, we can run different algorithms, for example, the PageRank algorithm or label propagation to detect communities. Or we can calculate, for example, whole ratios to understand the money flow. Databricks um has compatibility with graph frames. This means that it runs in a spark horizontally across many nodes and it scales to any number of accounts that you need to. Um I won't dive into this code, but it is pretty straightforward to use.
You can create some tables with the risk scores based on the scores of these algorithms. And at the end of the day, we can use the ground truth of the Bank of Thailand to set up the right threshold for the risk score and flag a few accounts. This is how the big network would look like, the one that we saw before, but in this case, we have color some of the nodes depending on their risk level. The ones that are in red are the confirmed mules, but we see now that there are some in orange and that is because they have a high score.
Many other ones are still in blue. The this means that these ones are not worth spending time on investigating and some other ones are in yellow, which means that there is a certain level of risk. This notebook is for data scientists when doing their research, but investigators would have access to different UI, in this case, Databricks app, where I have loaded the data from Lake Base, so it can load quite quickly. And I'm seeing here graph with the neighbors of these mules.
9:01 Visualizing risk with AI
And we can see here that there are also a few that are flagged. This is a subset of the previous network. And if we double click on one of them, we can see actually why it was a high risk score. In this case, the risk score is 0. 51 and it has a relatively high Patreon score. So, that's a level of centrality. And also a the behavior is like a pass-through. This means that money is flowing in and flowing out very quickly within 24 hours.
We can also change filters to see, okay, if we want to see which nodes are passing through at least 80% of the money within 24 hours, this is the network that we'll get. And this is where the investigators would have spent most of the time to understand who these people are and why they are behaving in this way. We can also use other information like the device IDs. For example, let me switch to another community that we have detected, a different part of the network that is a very um connected.
And instead of looking into transactions, I can see the devices that are shared. And in this case, we see that these three accounts were accessed through the same device. But also these other two ones were accessed through the same device where we had already detected before a mule account. So, this is definitely a red flag and we should investigate it as quick as possible. But there are many other signals that investigators might need to analyze further.
And for that, I have created a Genie room. And this Genie room it has preloaded the tables that we were using for the analysis and also the risk score. And I'm going to ask Genie a question. I'm going to ask, show me the top 10 accounts by total inflow with the clear monthly income and risk score for the ones that are not in the list of Bank of Thailand with a risk score higher than 0. 3. This is going to help me because if there is a lot of inflow of money, but uh the accounts, the people that own these accounts, they have a relatively low income, that would be a red flag that uh would point out that something is wrong and these people are receiving more money that uh their income, so there is something worth investigating.
11:07 Genie agent for investigation
And Genie has finished analyzing and we have here the top 10 accounts with total inflow, declared income, and score, and also the occupation level that might be coming from another system like know-your-customer information. And actually, we have a visualization here and we can see in the graph two type of bars on two different axes. The blue one that represents the total inflow of money. So, for example, for the first account, we see that it is um receiving 100 million Thai baht, so that corresponds to like 3 million US dollar.
But the actual uh amount of money probably is much lower. So, we can see here in the table that is only 12,000 uh baht, which corresponds to um 300 US dollar per month. So, definitely here this doesn't make much sense and it's worth investigating. We could ask a further question like um why was this account flagged? Then, what Genie is doing is to uh run some queries to try to find more data points around this flag and it will build a summary highlighting what are the um the potential signals uh uh that could help us come into a decision.
12:47 Automated reporting and output
Let's give it a minute or so for it to run. Okay. So, um looks like it is uh highlighting the mismatch of income. And also there is um uh it behaves like a hub. So, it is receiving money from 17 senders, but is distributed to 208 different receivers. So, it could act as a distribution um mule account that acts for distribution. Um there is a a pass-through profile. So, this means that very quickly the money is being sent out.
It doesn't keep the money for a long long time. And we could also download this as a report. It is going to be generated and downloaded into my computer and we would be able to send out this information. If we want to see the high-level picture, this is how it looks like. Source systems can be integrated into Data Bricks through Lake Flow Connect. We have connectors already for DB2, Oracle, SQL Server, and many more.
14:28 Reference architecture
And we can use Lake Flow pipelines to normalize the data, deduplicate it, and uh also run like I was showing before this notebook to compute different uh graph features like the page rank and the connected components and many more, and build the 360 view of the accounts and the customers in the storage layer in Silver so that it could be reused as um uh for different analysis. And since we have the ground truth from on Bank of Thailand, we could build ML models using notebooks and uh using them for training and learning from the ground truth of the mules and using these uh features that we derived before as uh extra signals that would help us in boosting the score.
And finally, I store these um mule scores in gold tables that would be synchronized into lake base and lake base would be serving the data bricks up. So, to wrap up, I want you to uh remember these uh three points of why we're doing this. Uh the first one is that if we manage to improve the mule detection, we would restore the customer trust. So, more customers will be likely to uh be onboarded into the bank. And uh that improves the confidence of um creating accounts there and not being flagged incorrectly.
15:51 Benefits and conclusion
And because there are more customers, there would be increased deposits, so that is more money that the bank can hold. And also, customers would be purchasing different products. So, fee-based income acts as as a big role here. And last but not least, it builds a positive relationship with the regulators, which would be good in the long term to decrease uh for example, compliance costs. And with that, I would thank you all all to for attending this session.
Hope you like it.
Learn more about the Databricks Data and AI platform.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.