Creating an automated transaction classifier with an LLM agent running on Mistral’s La Platforme

Recent events have caused increased interest in alternatives to American technology giants when it comes to various services, including AI. As a small hobby experiment, I wanted an AI to help me categorize my expenses based on an Excel export of my bank transactions.

First I tested providing the transaction list to various chatbots, asking them to help categorize them. I tested:

  • Gemini Gem (paid version with Gemini Pro 2.0): complained a lot about data format not being right, and then it categorized things wrong most of the time after telling it what the data structure was.
  • Copilot (free version): didn’t even attempt it, but explained how you can do it manually in Excel.
  • Grok3: Did the task very well but could not create a downloadable CSV file with the results.
  • Mistral Le Chat (free account): did the task quite well, and provided a downloadable CSV file. Some more errors in categorization than Grok3
  • Deepseek: didn’t want to give them transaction data…

To test things out I then created an agent in Mistral’s La Platforme. They have a web based interface for providing instructions to the agent, quite similar to Google Gem and Microsoft’s Copilot Studio.

I asked it to categorize first income using only two categories: “Salary” or “Other income”. I gave it more categories for expenses, and told it not to mix the categories from income to expenses and vice versar. It still got confused a few times, but worked well. The agent can be deployed to both an API and the chatbot “Le Chat”. The agent expects a text string to describe the transaction in the form of a number followed by a textual description. Here’s how it works in Le Chat:

Asking the AI agent to categorize a transaction of -9999 kr paid to “Google One”, it responds with the category “Media and Internet”, which has been defined in the agent instructions.

Now I want to use this in a Python script to categorize my transactions. I asked Le Chat to create a python script for me to extract transaction data into a dictionary, and then to use the La Platforme API to categorize each transaction. It first extracts the relevant data into a dataframe:

Then it iterates over the transactions and uses the agent API to ask for the category:

The result is a list of dictionaries of categorized transactions:

{‘Dato’: ‘24.02.2025’, ‘Beskrivelse’: ‘VIPPS NORSK TIPPING *8812 21.02 NOK 50.00 VIPPS NORSK TIPPING Kurs: 1.0000’, ‘Beløp’: -50.0, ‘Retning’: ‘Utgift’, ‘Kategori’: ‘Annet’}, {‘Dato’: ‘21.02.2025’, ‘Beskrivelse’: ‘REMA 1000 BREIDABLIKK *8812 20.02 NOK 97.20 REMA 1000 BREIDABLIKK Kurs: 1.0000’, ‘Beløp’: -97.2, ‘Retning’: ‘Utgift’, ‘Kategori’: ‘Dagligvarer’},

The quality of the categorization is generally good. At first I tried Mistral Nemo, a small and fast model developed with NVIDEA for categorization and simple tasks. It performed OK. Then I switched to Mistral Small 25.01, which had better performance but also a slightly different cost.

Some take-aways

  • Mistral is a European company and provides high-quality AI solutions
  • Their chatbot “Le Chat” and development platform “La Platforme” are both easy to use and well documented
  • A plus on the privacy side: all data is processed in Europe, using an Azure datacenter in Sweden, and a new data center will be built in France. The services are covered by EU regulations such as GDPR and the AI Act.

Leave a comment