- Kotlin
Part 2 of Kotlin: A Look Behind the Scenes at Flock and Hubble Fleet
- 12 November 2025
How Kotlin and AI Transformed Manual Work at Hubble Fleet
In the run-up to Kotlin Dev Days 2025, which we proudly sponsor, we’re giving the Kotlin community a platform.
CEOs, CTOs, development managers and engineers share how they use Kotlin to solve real-world problems out in the field, not just on the whiteboard.
Today we take a look behind the scenes at Flock, a Dutch team of Kotlin-minded engineers specialized in JVM technologies. Together with their partner Hubble Fleet, they automated the comparison of leasing contracts using Kotlin and Aigentic, an AI toolkit developed in-house by Flock (aigentic.io).
From manual Excel work to AI driven comparison
"Comparing lease contracts sounds simple, until you try putting multiple price matrices from different leasing companies side by side."
Nick Stuivenberg, Software Engineer at Flock
At Hubble Fleet, much of that work was still done manually. Employees entered rates into Excel and compared contracts line by line. This made the process slow and sensitive to error.
To tackle the problem, Flock and Hubble began with an event storming session to map the entire process of ordering, managing and terminating lease contracts. It became clear very quickly where the bottleneck was: comparing contracts and awarding them to the right leasing company.
The solution: Aigentic, where Kotlin and AI come together
Flock built Aigentic, a Kotlin based framework that allows developers to integrate AI agents into existing applications with full type safety and compile time control.
"Aigentic combines the power of large language models with the reliability of type safe Kotlin."
The framework supports multiple AI models such as Gemini, ChatGPT and Claude. It includes automatic error handling, retries and reproducible configurations. This keeps AI output predictable and reliable, which is essential in finance related workflows.
The implementation at Hubble Fleet
The first step was to automate the extraction of price matrices from Excel and PDF files.
The goal was clear: 70 percent automated through AI, 30 percent handled manually through mappers.
After several iterations and business rule checks, such as verifying whether amounts were valid numbers and whether tables decreased correctly for longer lease terms, the AI output became increasingly reliable.
With the latest Aigentic upgrade, Flock reached 99 percent accuracy when converting Excel and PDF files into structured data.
"We do not want AI to decide, but to support. The end user stays in control. The AI calculates, the human decides."
Kotlin as the foundation
Aigentic is written entirely in Kotlin, chosen for its reliability and type safety.
"With Kotlin, we know that whatever compiles is correct. You need that level of confidence when AI output directly influences financial decisions."
Because Aigentic runs on the JVM, integration with Hubble Fleet’s environment was smooth. Minimal friction, maximum stability. That is crucial in a domain where mistakes have direct financial consequences.
The results
• 99 percent correctly converted price matrices from Excel and PDF
• Strong reduction in manual input and error risk
• Full traceability across Hubble Fleet
• Easy extensibility thanks to Kotlin’s modular architecture
Flock and Hubble are now working on the next iteration, which will include automated recognition of emails and standard offers to speed up the process even further.
Developer Deep Dive: under the hood of Aigentic
For readers who want a closer look at the technical foundation:
• Coroutines and Ktor for non blocking request handling with structured concurrency
• Type safety through compile time validation of AI responses using sealed classes
• Retry mechanism with exponential backoff for LLM timeouts
• Parallelism through batching of PDF and Excel extraction using async builders
• Error handling with fallback logic between Gemini and ChatGPT using confidence thresholds
These patterns make Aigentic robust in JVM based enterprise environments.
About this series
With "Kotlin: A Look Behind the Scenes" we highlight how Dutch JVM organisations use Kotlin to create real world impact.
In the lead up to Kotlin Dev Days 2025, we speak with CTOs, engineering managers and developers who shape the craft of software development every day.
They build. We listen.
Want to join Kotlin Dev Days 2025
Follow our LinkedIn page for ticket raffles, community stories and new editions of Kotlin: A Look Behind the Scenes.
Visit our Kotlin Hub page now for more info!