How Multi-Agent AI Systems in Mendix Can Train You for a Marathon

Running is great—it helps you sleep better, boosts your immune system, and gives you that unbeatable feeling of progress, especially when you’re training for something big like a marathon. Just like running, building with Mendix can be both empowering and rewarding. And if you’re skeptical about low code, don’t be—Mendix gives you the flexibility to integrate with other platforms and the control you need to build serious, scalable applications.
So, with marathon season in full swing, we thought: why not show off Mendix’s multi-agent AI systems capabilities by building a smart app to help you train? In this blog, we’ll walk through how to create a multi-agent system in Mendix that supports developer-runners in reaching their goals. Because whether it’s logic in microflows or kilometers on the road, the best way to finish… is to start.
Why use multi-agent AI systems?
AI agents are everywhere right now—you’ve probably seen them all over your feed. But before we dive into building agent-based systems in Mendix, let’s take a quick step back and break down what an AI agent actually is.
AI agents
At its core, an AI agent (also called an LLM agent) is a smart program that can take action on its own when something triggers it—like a user doing something in an app, or another system sending data. These agents can use tools, functions, or even knowledge bases to figure out what to do. Some agents are built to learn over time, while others are focused on getting specific tasks done. Either way, the goal is to make life easier—by automating work, speeding up processes, or just making things run more smoothly.
If you’re brand new to this, check out our guide on how to build a single agent in Mendix. It covers how to combine prompt engineering, function calling, and knowledge bases—all within a Mendix app.
Sometimes, one agent just isn’t enough to get the job done. Single-agent systems work well for simpler tasks, but as problems get more complex or less clearly defined—just like in real life—it often takes a team. That’s where multi-agent systems come in. By working together, different agents can specialize in certain tasks and coordinate their efforts to reach better, more effective outcomes.
Putting multi-agent AI into practice
Once you understand the basics of AI and how Mendix works, building a multi-agent system isn’t as complicated as it sounds. If you’re just getting started, we recommend checking out our guide on how to build a single agent first, along with some helpful resources on prompt engineering.
What’s especially cool about multi-agent systems is that agents can work together in different ways—depending on the problem you’re trying to solve. They can follow a fixed flow, delegate tasks, evaluate each other’s output, or even make decisions about who should handle what.
To see these patterns in action, take a look at the GenAI Showcase App, and explore several multi-agent setups, including:
- Deterministic Flow / Prompt Chaining
- Deterministic Flow / Prompt Chaining with Gatekeeper
- Evaluator-Optimizer Agent
- Routing-Based Agent Collaboration
These examples show how flexible and powerful multi-agent systems can be—especially when built with Mendix.
Multi-agent routing pattern for the Mendix Running App
In this blog post, we’ll be referencing the GenAI Showcase App, especially the Routing example found in the Multi-Agent Patterns section. In this setup, the first agent acts as the routing agent. Its job isn’t to respond directly to the user—instead, it decides which of the available agents is best suited to handle the request. Once it makes that decision, it passes the entire conversation to the selected agent, which then takes over and manages the rest of the interaction.
In our example app, the router agent can choose from three different agents—each with their own role in helping members of the Mendix runner community become better runners. Here’s a quick breakdown of what each agent does:
- Running Coach Agent: This agent helps users build a training routine or marathon prep plan based on their goals.
- Nutritionist Agent: This one focuses on giving advice to improve nutrition, helping runners perform better or just be more aware of their eating habits.
- Running Facts Agent: This agent handles general running questions—like stats, fun facts, or anything outside the scope of coaching or nutrition. It also acts as the default agent when a question doesn’t fit the other two categories.
It’s worth noting that all three agents are focused only on running-related topics. They won’t be able to answer unrelated questions. The diagram above shows how this routing pattern is implemented in the app.
Getting started on the right foot
Mendix makes it super easy to get started with building your own agentic application—and the best way to jump in is with the Blank GenAI App. It comes preloaded with all the modules you need for a variety of models.
Already have an existing Mendix app? No problem. You can simply add the required modules—GenAI Commons, Conversational UI, and the Mx GenAI Connector—as long as you’re using Studio Pro 9.24.2 or higher. Just don’t forget to add the MxGenAIConnector.NAV_ConfigurationOverview_Open
microflow to your app navigation.
Follow these setup instructions after choosing your infrastructure provider.
With that, you’ll have everything you need to start building intelligent, multi-agent experiences fast.
Prompt engineering
The key to building a successful agent is getting the system prompt right—it’s what guides the agent’s behavior and decision-making. In the case of our router agent, the goal is simple: make sure each request gets sent to the right specialist.
- [System Prompt / Router] ‘You are an intent detection specialist. Your task is to classify the user intent on the last message of a conversation. If it is about sports diets, or nutritional information, return ” NUTRITIONIST ”. If it is about training plans or preparation for a sports event, return ”TRAINING”. If it is about general information about sport-related topic, return ”FACTS”. If it is about something not related to sports, return ”NONE”. Before you formulate your conclusion, make sure to consider the full conversation into account and extract the right context of the latest user message. You do not talk directly to the user, only specify the classification and your reasoning.
- Example: Intent: NUTRITIONIST | Reason: the user asked for nutritional tips in the conversation and now wants to exclude certain foods due to allergies.’
It’s essential that the router’s system prompt is clear and precise, since its output will be used programmatically in our microflow to decide which agent takes over the conversation. With that in place, we can shift our focus to the specialist agents. For these, we’ll keep things simple to start—each will have a straightforward prompt tailored to its specific area of expertise.
- [Running Coach Agent] ‘You are a running coach focused on providing a running plan to the user. Before providing recommendations, gather essential information: gender, age, target race type, and competition date. If any details are missing, ask the user. Include any additional questions you deem relevant for a comprehensive running plan’
- [Nutritionist Agent] ‘You are a sport nutritionist specializing in running diets. Before providing recommendations, gather essential information: gender, age, diet preferences, target race type, and competition date. If any details are missing, ask the user. Include any additional questions you deem relevant for a comprehensive nutritional plan.’
- [Running Facts Agent] ‘You are a running expert focused on providing running facts and advice to the user. To provide more insights, first provide the normal facts, and add another one considering the user’s age range and gender if available.’
Routing configurations
We’ll walk through how the routing example is configured, so you can use it as a reference when building your own agentic app.
We chose to use Mendix Cloud GenAI Resource Packs because they’re the fastest and easiest way to get started—no setup required, minimal maintenance, and zero operational hassle. Plus, we like to drink our own champagne (of course). If you want to try it out yourself, you can request access here.
Here’s how it all comes together in our example app: when a user sends a message in the chat (step 2 in the image above), a microflow is triggered behind the scenes. That’s where the Router Agent steps in. It looks at the conversation so far and decides which of the three specialist agents—Coach, Nutritionist, or Running Facts—should handle the request. Each one has a clear system prompt, so it stays focused on its specific area, and the microflow uses simple decision splits to send the request to the right place.
Let’s see this in action:
- Our user asks, “What should I eat the day of my marathon?”
- The Router Agent evaluates the conversation so far and decides which specialist agent should answer. In this case, it selects “NUTRITIONIST.”
- The microflow routes the request to the NUTRITIONIST agent with the question, “What should I eat the day of my marathon?”
- The NUTRITIONIST agent responds with advice on pre-race nutrition, such as high-carb foods and staying hydrated.
Combining all ingredients so far, we show below how the end result would look like. Since the best point to finish is to start, we interacted with the chat as a new runner. In the chat (step 2), the system provides the information that we are looking for to get us started with our running goal. On the left (step3), we can see the intermediate steps and which agent is called to generate the final answer. We built a conversational multi-agent system using the Chat Completion (with history) action, as seen in the image above, as well as default actions and snippets from the Conversational UI.

Crossing the finish line
Et voilà, your multi-agent system is up and running—just like you’re ready to hit the ground running! Mendix makes it easy to combine different agents into flexible multi-agent architectures to solve real-world problems.
In this example, we’ve leveraged the standard Maia for Smart Apps components and a couple of simple microflows to create a multi-agent routing system that helps guide our marathon training journey.
All much less arduous than actually running a marathon!
This article was co-written with Mendix Sr. Software Engineer Tom Warmerdam.
Frequently Asked Questions
-
What is a multi-agent AI system?
A multi-agent AI system is when several AI models, called Large Language Models (LLMs), work together to complete tasks triggered by a user or another system. Each agent in the system has a specific job, and by coordinating their efforts, they can provide better and more accurate results. This teamwork makes AI apps smarter and more effective at handling complex tasks.
-
Why build a multi-agent AI system in Mendix?
Mendix is built for modern enterprise software development, giving you the tools to create smarter, more powerful applications—faster. With its low-code platform and built-in AI capabilities, Mendix makes it easy to design and deploy multi-agent AI systems that adapt to real business needs. Whether you’re integrating multiple AI agents or building complex workflows, Mendix helps you work smarter, move faster, and deliver real results.
-
Do I need coding experience to build a multi-agent AI in Mendix?
Nope! You don’t need any background in coding for AI to get started. Mendix is a low-code platform that takes care of the heavy lifting, so you can build smart, AI-powered apps without writing complex code. With a basic understanding of what agents are, a little practice with prompt engineering, and a healthy dose of enthusiasm, you’ll be well on your way to building a multi-agent system.
-
Do I need an external subscription to services like Bedrock or OpenAI to create multi-agent AI systems in Mendix?
Not at all! With Mendix Cloud GenAI Resource Packs, you can build multi-agent AI systems without needing separate accounts or subscriptions to external services like Bedrock or OpenAI. These resource packs make it easy for Mendix users to tap into powerful GenAI capabilities—no complicated setup required. Just a few clicks, and you’re ready to go. If you want to learn more, feel free to reach out at [email protected].