Blog/

case-studies

Lua: From Worrying About Infrastructure to Focusing on Growing Partnerships

·

May 30, 2025

Stefan Kruger has spent the last two decades in African fintech. He was the VP of Engineering at West African payments startup Paystack, and joined Stripe when Paystack was acquired by Stripe in 2020.

He noticed something interesting. 90% of Africa's adult population uses WhatsApp daily. In the African market, using a mobile phone to conduct business doesn't mean using an app -- it means using chat.

That insight led him to team up with Lorcan O'Cathain, an Irish national who lived in Nairobi and Uganda for a decade, built an African fintech of his own, and made Forbes 30 Under 30.

In 2024, they started thinking about how they could leverage new AI technologies could help African consumers. They settled on helping African business connect with their customers through WhatsApp. Their resumes quickly brought seed funding, and they started to build.

Lua orchestrating a food order through WhatsApp, connecting users to restaurant partners like ChowPadi through simple chat

Building the initial systems

Stefan spent over 9 months building the core systems — agent orchestration, monitoring systems, workflow management, and evaluation frameworks. As a B2B2C technology, the Lua team knew they'd need robust infrastructure, and Stefan wanted to architect it to support 500k+ users at launch.

But in February and March, as they were supporting over 100 customers in pre-launch, with 4,500 end-users, things already felt like they were on fire.

Stefan had been wrestling with performance optimization. He'd disabled semantic searches under load due to memory and CPU constraints. He was trying to serve requests quickly at scale without breaking the bank on LLM calls.

He was also debugging his homegrown framework for running all of these agents, navigating complex stack traces through wrapped tool implementations.

Then he found Mastra.

Tossing their internal framework, moving to Mastra

Stefan's discovery of Mastra marked a turning point. Mastra provided exactly what they'd been building from scratch: workflows, agents, RAG, integrations, and evals—all in TypeScript, matching Lua's existing stack.

"I've been building since November last year, spending a lot of time figuring out just the foundational side of things—how to build agents very quickly, how do we monitor and how do we keep it solid," Stefan recalls. "I discovered your platform, I was like, holy, that would have saved me a ton of time." Stefan made a quick decision to move on from months of work on their own internal agent framework in favor of using Mastra's off the shelf primitives

The migration was fast. Stefan quickly got Lua's prototype fully running on Mastra, with agent orchestrations replicated quickly. Using Mastra's workflow primitives, the team was able to rapidly test complex orchestration scenarios, including hotel and flight booking integrations with end-to-end authentication flows.

As Stefan put it in March: "I wish I found you guys three months ago. I would have had less gray hair."

Lua's deployment architecture

Lua currently runs Mastra agents inside Hono servers, bundled into Docker containers within a Kubernetes cluster deployed on AWS EKS, with Neon handling their serverless Postgres backend. They're now running a parallel deployment on Mastra Cloud to test performance and reliability before fully migrating their business partners and potentially thousands of agents to eliminate infrastructure management overhead.

"We have 100 partners. I don't want to really manage 100 infrastructure components," Stefan explains. The built-in observability was particularly attractive: "Even the tracing and monitoring, like even running a separate stack for the monitoring side for us is just an overkill if you already have that all in there."

Stefan noted the improvements to Lua's development velocity. "Now we can just focus on the business side, which is more exciting for us. Just getting these businesses out, partnering up and getting it out to consumers."

Growth after launch

The launch was a huge success, and right now, the Lua team is running quickly to keep up with demand both in the Middle East as well as East Africa. It's still early, but at one point in May, they were getting 200 new users every 10 minutes. At the last check-in, infrastructure and tooling were not fires they were fighting, or had recently fought.

Stay up to date